关于ionic(ios)集成jpush问题

ionic
标签: #<Tag:0x00007fb83786d110>

(zhmj) #9

我现在遇到的情况是我在极光推送的后台发送通知,ios目标成功,但是我app无法接受通知,也无法获取registrationID


(zhmj) #10

android接受正常


#11

iOS无法获取到registrationID的,给我提供你的集成日志


(zhmj) #13
objc[5429]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11d6a5998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x11d4c7880). One of the two will be used. Which one is undefined.
2017-03-27 11:02:47.598 新钢集团[5429:52508] Apache Cordova native platform version 4.1.1 is starting.
2017-03-27 11:02:47.599 新钢集团[5429:52508] Multi-tasking -> Device: YES, App: YES
2017-03-27 11:02:47.600 新钢集团[5429:52508] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.2--build:28----------
--------------------JCore Lib Version:1.1.1--build:11----------
-----------------AppKey:(null)----------------
----------------------------------------------------------------
2017-03-27 11:02:47.601 新钢集团[5429:52508] JPush WARNING! APNs is NOT supported on simulator
2017-03-27 11:02:47.650 新钢集团[5429:52508] Using UIWebView
2017-03-27 11:02:47.652 新钢集团[5429:52508] [CDVTimer][handleopenurl] 0.092983ms
2017-03-27 11:02:47.654 新钢集团[5429:52508] [CDVTimer][intentandnavigationfilter] 1.653016ms
2017-03-27 11:02:47.654 新钢集团[5429:52508] [CDVTimer][gesturehandler] 0.082016ms
2017-03-27 11:02:47.664 新钢集团[5429:52508] [CDVTimer][file] 10.015011ms
2017-03-27 11:02:47.678 新钢集团[5429:52508] [CDVTimer][splashscreen] 13.894022ms
2017-03-27 11:02:47.684 新钢集团[5429:52508] [CDVTimer][statusbar] 5.100012ms
2017-03-27 11:02:47.720 新钢集团[5429:52508] cordova-plugin-wechat has been initialized. Wechat SDK Version: 1.7.2. APP_ID: wx448104dcf470edc4.
2017-03-27 11:02:47.720 新钢集团[5429:52508] [CDVTimer][wechat] 36.246002ms
2017-03-27 11:02:47.722 新钢集团[5429:52508] [CDVTimer][keyboard] 1.457036ms
2017-03-27 11:02:47.723 新钢集团[5429:52508] [CDVTimer][canvas2imageplugin] 0.117004ms
2017-03-27 11:02:47.723 新钢集团[5429:52508] [CDVTimer][TotalPluginStartup] 71.205020ms
2017-03-27 11:02:47.726377 新钢集团[5429:52566] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-03-27 11:02:47.726929 新钢集团[5429:52566] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-03-27 11:02:47.729340 新钢集团[5429:52601] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-03-27 11:02:47.732 新钢集团[5429:52508] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.2--build:28----------
--------------------JCore Lib Version:1.1.1--build:11----------
-----------------AppKey:********************************----------------
----------------------------------------------------------------
2017-03-27 11:02:47.733 新钢集团[5429:52508] JPush WARNING! APNs is NOT supported on simulator
2017-03-27 11:02:47.736426 新钢集团[5429:52601] [] ____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed
2017-03-27 11:02:47.736783 新钢集团[5429:52601] [] __nwlog_err_simulate_crash simulate crash failed "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-03-27 11:02:47.738014 新钢集团[5429:52601] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
        [x86_64] libnetcore-856.30.16
    0   libsystem_network.dylib             0x0000000113e74666 __nw_create_backtrace_string + 123
    1   libnetwork.dylib                    0x00000001141b0006 nw_socket_add_input_handler + 3164
    2   libnetwork.dylib                    0x000000011418d555 nw_endpoint_flow_attach_protocols + 3768
    3   libnetwork.dylib                    0x000000011418c572 nw_endpoint_flow_setup_socket + 563
    4   libnetwork.dylib                    0x000000011418b298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
    5   libnetwork.dylib                    0x00000001141a6ae1 nw_endpoint_handler_path_change + 1261
    6   libnetwork.dylib                    0x00000001141a6510 nw_endpoint_handler_start + 570
    7   libnetwork.dylib                    0x00000001141be1f9 nw_endpoint_resolver_start_next_child + 2240
    8   libdispatch.dylib                   0x0000000113bf1978 _dispatch_call_block_and_release + 12
    9   libdispatch.dylib                   0x0000000113c1b0cd _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x0000000113bf8e17 _dispatch_queue_serial_drain + 236
    11  libdispatch.dylib                   0x0000000113bf9b4b _dispatch_queue_invoke + 1073
    12  libdispatch.dylib                   0x0000000113bfc385 _dispatch_root_queue_drain + 720
    13  libdispatch.dylib                   0x0000000113bfc059 _dispatch_worker_thread3 + 123
    14  libsystem_pthread.dylib             0x0000000113fc44de _pthread_wqthread + 1129
    15  libsystem_pthread.dylib             0x0000000113fc2341 start_wqthread + 13
2017-03-27 11:02:48.376 新钢集团[5429:52508] Resetting plugins due to page load.
2017-03-27 11:02:48.481666 新钢集团[5429:52568] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-03-27 11:02:48.483106 新钢集团[5429:52568] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
        [x86_64] libnetcore-856.30.16
    0   libsystem_network.dylib             0x0000000113e74666 __nw_create_backtrace_string + 123
    1   libnetwork.dylib                    0x00000001141b0006 nw_socket_add_input_handler + 3164
    2   libnetwork.dylib                    0x000000011418d555 nw_endpoint_flow_attach_protocols + 3768
    3   libnetwork.dylib                    0x000000011418c572 nw_endpoint_flow_setup_socket + 563
    4   libnetwork.dylib                    0x000000011418b298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
    5   libnetwork.dylib                    0x00000001141a6ae1 nw_endpoint_handler_path_change + 1261
    6   libnetwork.dylib                    0x00000001141a6510 nw_endpoint_handler_start + 570
    7   libdispatch.dylib                   0x0000000113bf1978 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x0000000113c1b0cd _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000113bf8e17 _dispatch_queue_serial_drain + 236
    10  libdispatch.dylib                   0x0000000113bf9b4b _dispatch_queue_invoke + 1073
    11  libdispatch.dylib                   0x0000000113bfc385 _dispatch_root_queue_drain + 720
    12  libdispatch.dylib                   0x0000000113bfc059 _dispatch_worker_thread3 + 123
    13  libsystem_pthread.dylib             0x0000000113fc44de _pthread_wqthread + 1129
    14  libsystem_pthread.dylib             0x0000000113fc2341 start_wqthread + 13
2017-03-27 11:02:48.999148 新钢集团[5429:52565] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-03-27 11:02:48.999743 新钢集团[5429:52565] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
        [x86_64] libnetcore-856.30.16
    0   libsystem_network.dylib             0x0000000113e74666 __nw_create_backtrace_string + 123
    1   libnetwork.dylib                    0x00000001141b0006 nw_socket_add_input_handler + 3164
    2   libnetwork.dylib                    0x000000011418d555 nw_endpoint_flow_attach_protocols + 3768
    3   libnetwork.dylib                    0x000000011418c572 nw_endpoint_flow_setup_socket + 563
    4   libnetwork.dylib                    0x000000011418b298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
    5   libnetwork.dylib                    0x00000001141a6ae1 nw_endpoint_handler_path_change + 1261
    6   libnetwork.dylib                    0x00000001141a6510 nw_endpoint_handler_start + 570
    7   libdispatch.dylib                   0x0000000113bf1978 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x0000000113c1b0cd _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000113bf8e17 _dispatch_queue_serial_drain + 236
    10  libdispatch.dylib                   0x0000000113bf9b4b _dispatch_queue_invoke + 1073
    11  libdispatch.dylib                   0x0000000113bfc385 _dispatch_root_queue_drain + 720
    12  libdispatch.dylib                   0x0000000113bfc059 _dispatch_worker_thread3 + 123
    13  libsystem_pthread.dylib             0x0000000113fc44de _pthread_wqthread + 1129
    14  libsystem_pthread.dylib             0x0000000113fc2341 start_wqthread + 13
2017-03-27 11:02:49.004568 新钢集团[5429:52565] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-03-27 11:02:49.005223 新钢集团[5429:52565] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
        [x86_64] libnetcore-856.30.16
    0   libsystem_network.dylib             0x0000000113e74666 __nw_create_backtrace_string + 123
    1   libnetwork.dylib                    0x00000001141b0006 nw_socket_add_input_handler + 3164
    2   libnetwork.dylib                    0x000000011418d555 nw_endpoint_flow_attach_protocols + 3768
    3   libnetwork.dylib                    0x000000011418c572 nw_endpoint_flow_setup_socket + 563
    4   libnetwork.dylib                    0x000000011418b298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
    5   libnetwork.dylib                    0x00000001141a6ae1 nw_endpoint_handler_path_change + 1261
    6   libnetwork.dylib                    0x00000001141a6510 nw_endpoint_handler_start + 570
    7   libdispatch.dylib                   0x0000000113bf1978 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x0000000113c1b0cd _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000113bf8e17 _dispatch_queue_serial_drain + 236
    10  libdispatch.dylib                   0x0000000113bf9b4b _dispatch_queue_invoke + 1073
    11  libdispatch.dylib                   0x0000000113bfc385 _dispatch_root_queue_drain + 720
    12  libdispatch.dylib                   0x0000000113bfc059 _dispatch_worker_thread3 + 123
    13  libsystem_pthread.dylib             0x0000000113fc44de _pthread_wqthread + 1129
    14  libsystem_pthread.dylib             0x0000000113fc2341 start_wqthread + 13
2017-03-27 11:02:49.008854 新钢集团[5429:52565] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-03-27 11:02:49.009468 新钢集团[5429:52565] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
        [x86_64] libnetcore-856.30.16
    0   libsystem_network.dylib             0x0000000113e74666 __nw_create_backtrace_string + 123
    1   libnetwork.dylib                    0x00000001141b0006 nw_socket_add_input_handler + 3164
    2   libnetwork.dylib                    0x000000011418d555 nw_endpoint_flow_attach_protocols + 3768
    3   libnetwork.dylib                    0x000000011418c572 nw_endpoint_flow_setup_socket + 563
    4   libnetwork.dylib                    0x000000011418b298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
    5   libnetwork.dylib                    0x00000001141a6ae1 nw_endpoint_handler_path_change + 1261
    6   libnetwork.dylib                    0x00000001141a6510 nw_endpoint_handler_start + 570
    7   libdispatch.dylib                   0x0000000113bf1978 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x0000000113c1b0cd _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000113bf8e17 _dispatch_queue_serial_drain + 236
    10  libdispatch.dylib                   0x0000000113bf9b4b _dispatch_queue_invoke + 1073
    11  libdispatch.dylib                   0x0000000113bfc385 _dispatch_root_queue_drain + 720
    12  libdispatch.dylib                   0x0000000113bfc059 _dispatch_worker_thread3 + 123
    13  libsystem_pthread.dylib             0x0000000113fc44de _pthread_wqthread + 1129
    14  libsystem_pthread.dylib             0x0000000113fc2341 start_wqthread + 13
2017-03-27 11:02:49.252 新钢集团[5429:52508] Finished load of: file:///Users/denghuimin/Library/Developer/CoreSimulator/Devices/1AC3AA6D-3805-4EFB-9AE7-6F813B93ACF7/data/Containers/Bundle/Application/774F565C-39C9-45E4-A7D5-AA183C748F5C/%E6%96%B0%E9%92%A2%E9%9B%86%E5%9B%A2.app/www/index.html#/tab/home
2017-03-27 11:02:49.273 新钢集团[5429:52508] ### pluginInitialize 
2017-03-27 11:02:49.274 新钢集团[5429:52508] Cordova callback block returned unrecognized type: (null)
2017-03-27 11:02:49.279 新钢集团[5429:52508] Javascript Callback Error: null

#14

你在模拟器上做的集成和测试?

iOS不支持在模拟器上做推送测试。


(zhmj) #15

我测试是在真机上测试的,真机上怎么输出日志啊


#16

(zhmj) #17

我是根据http://blog.csdn.net/nobmr/article/details/52587416这个配置的,我没有开发的证书,所以日志比较吗发。这个主要是会跟那些配置相关啊


#18

1、没有日志不是很好判断问题
2、获取不到registrationID,在真机上,原因有可能是你的方法调用的过早,在未初始化成功的时候就调用了,将API写的靠后一点试试
3、请根据 phonegap插件的readme去集成,ionic调用可参考:
http://ionichina.com/topic/54fab88b7b505d9b1b5573a6


(zhmj) #19

我现在能接收到通知,但是setAlias后根据Alia发送是现实没有用户注册


(zhmj) #20

registrationID需要给你发吗


#21

说明你别名没有设置成功


(zhmj) #22

我调用的是window.plugins.jPushPlugin.setAlias(alias);这个方法。出问题的是ios,android没问题


#23

1、一样的,首先,所有极光的API请在 初始化成功后进行,也就是你获取registrationID成功了再调用才可成功
2、请自行检查方法调用后的返回信息,是否有错误码。
监听下设置结果:


(zhmj) #24

给我返回了6003;
6003 alias 字符串不合法。 有效的别名、标签组成:字母(区分大小写)、数字、下划线、汉字。
我设置是70630


#25

请打印下你真正的别名值,请注意别名的要求是字符串,以及你可以跑一下example,以及注意ionic的调用方式。


(zhmj) #26

isTrusted:false, “alias”:“70630”,“resultCode”: 0,“tags”:null;
在极光后台发送成功,但是java服务端发送无法接收通知
推送信息:{“msg_id”:7541799835,“sendno”:1230710936,“statusCode”:0}后台返回信息。


#27

给我提供你服务端推送没收到消息的设备的registrationID


#28

你服务端推送的是开发环境,官网推送的生产环境

请修改服务端推送的代码 apns_production为true


#29

我加了这段代码,为什么没有执行啊