Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

几个问题 #9

Open
xml777 opened this issue Aug 17, 2015 · 65 comments
Open

几个问题 #9

xml777 opened this issue Aug 17, 2015 · 65 comments
Assignees

Comments

@xml777
Copy link

xml777 commented Aug 17, 2015

1.xgpush 是大写还是小写?感觉加了这个插件以后, js里面找不到 xgpush.
2.xgpush 提示 "XGPush.addlistener" 是什么意思?

@gengen1988
Copy link
Member

  1. xgpush 是全小写

    解释:这个是 Cordova 插件,Cordova 插件需要在 deviceready 方法里调用,例如:

    document.addEventListener('deviceready', function() {
      xgpush.registerPush('myalias');
    }, false);
  2. 这个提示还有其他内容,只有这些信息不清楚是什么问题

    解释:XGPush.addlistener 是插件内部和原生部分互相通讯的接口,在代码里处理推送到的数据依赖这个方法

@xml777
Copy link
Author

xml777 commented Aug 18, 2015

非常感谢您的回复:

ripple调试无法使用,这个可以理解。不过我咋模拟器和真机上无法使用。直接就白屏了。应该是还没有进入主程序就挂了。

我的开发环境是 visual studio 2015 + cordova。

@xml777
Copy link
Author

xml777 commented Aug 18, 2015

是不是还要设置什么

@gengen1988
Copy link
Member

试试这个应用,这个至少在我这里不会白屏。
http://pan.baidu.com/s/13EBs

修改 AndroidManifest.xml 里的 meta-data 成自己的 access id 和 access key 就能收到推送

@xml777
Copy link
Author

xml777 commented Aug 18, 2015

ios 和 android 推送都可以了,好些必须在真机上才行,模拟器不行。

但奇怪的是 应用程序还是白屏,应该是你的推送程序应该已经运行,但可能发生了什么错误。导致后续程序无法执行。

@xml777
Copy link
Author

xml777 commented Aug 18, 2015

我几乎找找遍了全世界的 cordova-push 插件, 你这个应该是做的比较好的了,基本上就是开箱即用。不用额外修改代码。 aearogear push 也不错,可惜用的是gcm。国内无法使用。

我再提个小小的意见:
因为信鸽推送是把android 和 ios 分开的。access id 和 access key 都是独立的。这样的话我还不得不建立两个工程分别来编译 ios 和 android 。比较麻烦。最好在regsister的方法中指定 这两个参数。

我再研究一下白屏的问题。

非常感谢你提供的这个插件!

@gengen1988
Copy link
Member

多谢捧场,插件的完善还有赖大家的反馈

关于分开的 access id 和 access key,可以写到 config.xml 的 platform 配置里,例如:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.eteng.xgpushtest" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>xgpush</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" version="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <plugin name="cordova-plugin-xgpush" spec="https://github.com/gengen1988/xgpush-cordova">
            <variable name="ACCESS_ID" value="2100138308" />
            <variable name="ACCESS_KEY" value="AJG63C97Y9NV" />
        </plugin>
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <plugin name="cordova-plugin-xgpush" spec="https://github.com/gengen1988/xgpush-cordova">
            <variable name="ACCESS_ID" value="2100138308" />
            <variable name="ACCESS_KEY" value="AJG63C97Y9NV" />
        </plugin>
    </platform>
    <engine name="android" spec="^4.0.2" />
</widget>

register 是否加入正在检讨中

@xml777
Copy link
Author

xml777 commented Aug 18, 2015

OK,非常感谢!

我再看看白屏是什么问题

@xml777
Copy link
Author

xml777 commented Aug 19, 2015

regsisterpush方法设置别名没有成功

@gengen1988
Copy link
Member

android 还是 ios?

@xml777
Copy link
Author

xml777 commented Aug 20, 2015

两个都是,是先服务器注册成功,但设置别名时就挂了

@xml777
Copy link
Author

xml777 commented Aug 20, 2015

android 和 ios 都是真机测试。
android 模拟器也一样。

@gengen1988
Copy link
Member

能把挂了的 log 贴出来吗,logcat 里的

@xml777
Copy link
Author

xml777 commented Aug 20, 2015

log在哪里设置?

@xml777
Copy link
Author

xml777 commented Aug 20, 2015

插件应该在 ondeviceready之前就挂了,这个还比较奇怪

@gengen1988
Copy link
Member

显示日志(插上线):

$ adb shell
# logcat

参考:
http://developer.android.com/tools/help/logcat.html

@xml777
Copy link
Author

xml777 commented Aug 21, 2015

你看一下这个有用吗?
我把visual studio 2015 的 cordova工程导入到 android studio 中,执行的结果。

08-21 02:19:05.198 2179-2179/com.udianqu.auto D/dalvikvm﹕ Not late-enabling CheckJNI (already on)
08-21 02:19:13.948 2179-2179/com.udianqu.auto V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {b1d0abc8}
08-21 02:19:14.238 2179-2179/com.udianqu.auto I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
08-21 02:19:14.738 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:library_loader_hooks.cc(116)] Chromium logging enabled: level = 0, default verbosity = 0
08-21 02:19:14.778 2179-2179/com.udianqu.auto I/BrowserStartupController﹕ Initializing chromium process, renderers=0
08-21 02:19:14.878 2179-2179/com.udianqu.auto E/AudioManagerAndroid﹕ BLUETOOTH permission is missing!
08-21 02:19:14.968 2179-2179/com.udianqu.auto E/chromium﹕ [ERROR:gl_surface_egl.cc(169)] No suitable EGL configs found.
08-21 02:19:14.968 2179-2179/com.udianqu.auto E/chromium﹕ [ERROR:gl_surface_egl.cc(702)] GLSurfaceEGL::InitializeOneOff failed.
08-21 02:19:14.968 2179-2179/com.udianqu.auto E/chromium﹕ [ERROR:gl_surface_egl.cc(169)] No suitable EGL configs found.
08-21 02:19:14.978 2179-2179/com.udianqu.auto E/chromium﹕ [ERROR:gl_surface_egl.cc(702)] GLSurfaceEGL::InitializeOneOff failed.
08-21 02:19:14.978 2179-2179/com.udianqu.auto E/chromium﹕ [ERROR:gpu_info_collector.cc(86)] gfx::GLSurface::InitializeOneOff() failed
08-21 02:19:15.088 2179-2179/com.udianqu.auto W/chromium﹕ [WARNING:mailbox_synchronizer.cc(36)] MailboxSync not supported due to missing EGL image/fence support
08-21 02:19:15.188 2179-2223/com.udianqu.auto E/chromium﹕ [ERROR:gl_surface_egl.cc(169)] No suitable EGL configs found.
08-21 02:19:15.198 2179-2223/com.udianqu.auto E/chromium﹕ [ERROR:gl_surface_egl.cc(702)] GLSurfaceEGL::InitializeOneOff failed.
08-21 02:19:15.348 2179-2179/com.udianqu.auto D/dalvikvm﹕ GC_FOR_ALLOC freed 90K, 5% free 3049K/3208K, paused 82ms, total 94ms
08-21 02:19:15.368 2179-2179/com.udianqu.auto I/dalvikvm-heap﹕ Grow heap (frag case) to 4.115MB for 1127536-byte allocation
08-21 02:19:15.578 2179-2190/com.udianqu.auto D/dalvikvm﹕ GC_FOR_ALLOC freed <1K, 4% free 4150K/4312K, paused 201ms, total 201ms
08-21 02:19:15.738 2179-2221/com.udianqu.auto W/chromium﹕ [WARNING:proxy_service.cc(890)] PAC support disabled because there is no system implementation
08-21 02:19:15.878 2179-2179/com.udianqu.auto I/dalvikvm﹕ Could not find method android.webkit.CookieManager.setAcceptThirdPartyCookies, referenced from method org.apache.cordova.engine.SystemCookieManager.
08-21 02:19:15.878 2179-2179/com.udianqu.auto W/dalvikvm﹕ VFY: unable to resolve virtual method 9448: Landroid/webkit/CookieManager;.setAcceptThirdPartyCookies (Landroid/webkit/WebView;Z)V
08-21 02:19:15.888 2179-2179/com.udianqu.auto D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0016
08-21 02:19:15.888 2179-2179/com.udianqu.auto I/dalvikvm﹕ Could not find method android.webkit.CookieManager.flush, referenced from method org.apache.cordova.engine.SystemCookieManager.flush
08-21 02:19:15.888 2179-2179/com.udianqu.auto W/dalvikvm﹕ VFY: unable to resolve virtual method 9443: Landroid/webkit/CookieManager;.flush ()V
08-21 02:19:15.888 2179-2179/com.udianqu.auto D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0008
08-21 02:19:15.938 2179-2179/com.udianqu.auto W/dalvikvm﹕ VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
08-21 02:19:15.938 2179-2179/com.udianqu.auto W/dalvikvm﹕ VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
08-21 02:19:15.948 2179-2179/com.udianqu.auto I/dalvikvm﹕ Could not find method android.webkit.WebViewClient.onReceivedClientCertRequest, referenced from method org.apache.cordova.engine.SystemWebViewClient.onReceivedClientCertRequest
08-21 02:19:15.948 2179-2179/com.udianqu.auto W/dalvikvm﹕ VFY: unable to resolve virtual method 9499: Landroid/webkit/WebViewClient;.onReceivedClientCertRequest (Landroid/webkit/WebView;Landroid/webkit/ClientCertRequest;)V
08-21 02:19:15.948 2179-2179/com.udianqu.auto D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x001a
08-21 02:19:15.978 2179-2179/com.udianqu.auto I/dalvikvm﹕ Could not find method android.webkit.WebChromeClient$FileChooserParams.createIntent, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onShowFileChooser
08-21 02:19:15.978 2179-2179/com.udianqu.auto W/dalvikvm﹕ VFY: unable to resolve virtual method 9463: Landroid/webkit/WebChromeClient$FileChooserParams;.createIntent ()Landroid/content/Intent;
08-21 02:19:15.978 2179-2179/com.udianqu.auto D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0000
08-21 02:19:16.018 2179-2179/com.udianqu.auto D/SystemWebViewEngine﹕ CordovaWebView is running on device made by: unknown
08-21 02:19:16.578 2179-2179/com.udianqu.auto D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
08-21 02:19:16.688 2179-2179/com.udianqu.auto W/AwContents﹕ nativeOnDraw failed; clearing to background color.
08-21 02:19:19.618 2179-2179/com.udianqu.auto W/AwContents﹕ nativeOnDraw failed; clearing to background color.
08-21 02:19:19.808 2179-2179/com.udianqu.auto W/AwContents﹕ nativeOnDraw failed; clearing to background color.
08-21 02:19:35.508 2179-2179/com.udianqu.auto D/JsMessageQueue﹕ Set native->JS mode to OnlineEventsBridgeMode
08-21 02:19:38.368 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(11)] "Uncaught ReferenceError: angular is not defined", source: file:///android_asset/www/js/app.js (11)
08-21 02:19:40.398 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(1188)] "deviceready has not fired after 5 seconds.", source: file:///android_asset/www/cordova.js (1188)
08-21 02:19:40.398 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onPluginsReady", source: file:///android_asset/www/cordova.js (1181)
08-21 02:19:40.448 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onCordovaReady", source: file:///android_asset/www/cordova.js (1181)
08-21 02:19:40.448 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(1181)] "Channel not fired: onDOMContentLoaded", source: file:///android_asset/www/cordova.js (1181)
08-21 02:19:40.648 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(1)] "Uncaught ReferenceError: angular is not defined", source: file:///android_asset/www/js/controllers.js (1)
08-21 02:19:40.708 2179-2179/com.udianqu.auto I/chromium﹕ [INFO:CONSOLE(1)] "Uncaught ReferenceError: angular is not defined", source: file:///android_asset/www/js/services.js (1)
08-21 02:19:43.638 2179-2243/com.udianqu.auto D/XGCordovaPlugin﹕ > plugin invoke
08-21 02:19:43.718 2179-2243/com.udianqu.auto D/XGCordovaPlugin﹕ > register: null
08-21 02:19:43.778 2179-2243/com.udianqu.auto D/XGCordovaPlugin﹕ > register private
08-21 02:19:43.918 2179-2243/com.udianqu.auto W/PluginManager﹕ THREAD WARNING: exec() call to XGPush.registerpush blocked the main thread for 266ms. Plugin should use CordovaInterface.getThreadPool().
08-21 02:19:44.078 2179-2353/com.udianqu.auto D/dalvikvm﹕ Trying to load lib /data/app-lib/com.udianqu.auto-1/libtpnsSecurity.so 0xb1d11648
08-21 02:19:44.238 2179-2353/com.udianqu.auto D/dalvikvm﹕ Added shared lib /data/app-lib/com.udianqu.auto-1/libtpnsSecurity.so 0xb1d11648
08-21 02:19:44.308 2179-2353/com.udianqu.auto I/TpnsSecurity﹕ JNI_OnLoad
08-21 02:19:44.688 2179-2243/com.udianqu.auto D/XGCordovaPlugin﹕ > plugin invoke
08-21 02:19:44.908 2179-2243/com.udianqu.auto W/PluginManager﹕ THREAD WARNING: exec() call to XGPush.addlistener blocked the main thread for 215ms. Plugin should use CordovaInterface.getThreadPool().
08-21 02:19:45.258 2179-2359/com.udianqu.auto D/dalvikvm﹕ GC_FOR_ALLOC freed 326K, 9% free 4315K/4712K, paused 78ms, total 80ms

@xml777
Copy link
Author

xml777 commented Aug 21, 2015

我cordova 用的 是 5.1.1

@xml777
Copy link
Author

xml777 commented Aug 21, 2015

程序启动的时候,这个插件就会自动去注册一次,这个时候别名是null. 这个步骤好些没有必要。注册应该让开发者手工调用代码去注册。

@gengen1988
Copy link
Member

对了,你的测试机的机型是什么?如果不是 arm 的话需要把相应的库拷到项目里

另外白屏的原因好像是 AngularJS 没加载上

@xml777
Copy link
Author

xml777 commented Aug 22, 2015

是arm,
的确是 angularjs 没加载上,去掉这个插件就可以了。

@rerenWorkGit
Copy link

安装好插件后,测试预览时可以接收到消息,确认推送却一直接受不到消息,是为什么?

@gengen1988 gengen1988 assigned JrontEnd and gengen1988 and unassigned JrontEnd and gengen1988 Dec 8, 2015
@JrontEnd
Copy link

JrontEnd commented Dec 9, 2015

您好,请您描述下插件的版本,插件平台的版本以及所使用的机型。

@welchwsy
Copy link

welchwsy commented Dec 9, 2015

这几天信鸽推送的服务端有延迟故障,信鸽论坛,你可以登录信鸽的网页管理端查看推送状态。

@rerenWorkGit
Copy link

我就是用网页管理端发送的消息,测试预览推送可以送达,推送到某个账号也可以送达,正式推送到所有设备不能送达,我的测试手机是红米note2,android4.4.4,插件是最新版本的。如果说安装完插件后,推送消息到所有设备,就不用添加代码如下代码了吧
document.addEventListener('deviceready', function() {
xgpush.registerPush();
}, false);

@rerenWorkGit
Copy link

申请的推送证书
按友盟官网里的步骤申请的

@rerenWorkGit
Copy link

推送对系统有要求吗?

@rerenWorkGit
Copy link

@JrontEnd 你是在模拟器上测试的吗?96b1150083a6609f864a5428d5644864310937fca6ffe457c58fb7a87db9de22
我在模拟器上获取的也是这个,模拟器能收消息推送吗?

@JrontEnd
Copy link

@rerenWorkGit 是的,模拟器,但是收不到消息,收消息必须是真机

@rerenWorkGit
Copy link

在真机上就获取不到token,都会是什么原因?我第一次用,没有头绪,查质料也查不到,只能求助这里了。一般模拟器上能获取到token,真机上就能获取到吗?

@JrontEnd
Copy link

可以给你一些解决办法:
1.在苹果开发者官网检查是否应用有推送权限
2.更新iOS应用配置文件
3.在信鸽官网检查是否验证了推送证书
4.检查下config.xml中推送配置是否和信鸽提供的一致

@YangWenChaoTony
Copy link

我用的是intelxdk开发环境,服务端编译时出现以下错误
** BUILD FAILED **

The following build commands failed:
Ld build/SiteWebH5.build/Release-iphoneos/SiteWebH5.build/Objects-normal/armv7s/SiteWebH5 normal armv7s
(1 failure)
Command finished with error code 65: .../SiteWeb_App_HTML5_1/platforms/ios/cordova/build --release,--device
Error: .../SiteWeb_App_HTML5_1/platforms/ios/cordova/build: Command failed with exit code 65
at ChildProcess.whenDone (/Developer/cordova/4.1.2/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
我想知道,如何去掉 build.js 里的 armv7s???
在线等,急!

@JrontEnd
Copy link

在这个路径下:

platforms/ios/cordova/lib/build.js

全文搜索armv7s,删除所有搜出来的armv7s即可。

@YangWenChaoTony
Copy link

intel xdk是云端编译,编译时会主动把本地代码传到服务器,然后编译好后去下载包,开发机器也就是客户端根本看不到这些。郁闷了。

@rerenWorkGit
Copy link

@JrontEnd 你说的2,3,4条我都检查了没问题,只是第一条要怎么检查?
2016-01-04 11:54:24.306 zhanwei[501:218630] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/D3A17B78-D31F-4F53-87A4-E71955A9970E/Library/Cookies/Cookies.binarycookies
2016-01-04 11:54:25.227 zhanwei[501:218630] Apache Cordova native platform version 3.8.0 is starting.
2016-01-04 11:54:25.229 zhanwei[501:218630] Multi-tasking -> Device: YES, App: YES
2016-01-04 11:54:25.240 zhanwei[501:218630] Unlimited access to network resources
2016-01-04 11:54:26.154 zhanwei[501:218630] [CDVTimer][splashscreen] 701.049030ms
2016-01-04 11:54:26.164 zhanwei[501:218630] [CDVTimer][statusbar] 9.849012ms
2016-01-04 11:54:26.165 zhanwei[501:218630] [CDVTimer][keyboard] 0.618994ms
2016-01-04 11:54:26.167 zhanwei[501:218630] [XGPush] starting with access id: 2200173812, access key: IX4VAV9D989I
2016-01-04 11:54:26.188 zhanwei[501:218630] [XGPush] init for re-register
2016-01-04 11:54:26.191 zhanwei[501:218630] open sqlite db ok.
2016-01-04 11:54:26.196 zhanwei[501:218630] [CDVTimer][xgpush] 30.083001ms
2016-01-04 11:54:26.197 zhanwei[501:218630] [CDVTimer][TotalPluginStartup] 743.915021ms
2016-01-04 11:54:26.562 zhanwei[501:218630] [CDVRegisterNotification] register notification
2016-01-04 11:54:26.563 zhanwei[501:218630] [CDVRegisterNotification] register ios 8
2016-01-04 11:54:26.604 zhanwei[501:218630] [XGPushPlugin] register fail
2016-01-04 11:54:27.030 zhanwei[501:218630] Resetting plugins due to page load.
2016-01-04 11:54:28.781 zhanwei[501:218630] [XGPushPlugin] registerpush:
2016-01-04 11:54:28.781 zhanwei[501:218630] [XGPush] register with token:(null) alias:
2016-01-04 11:54:28.785 zhanwei[501:218630] [xgpush error]deviceToken is nil
2016-01-04 11:54:28.786 zhanwei[501:218630] [XGPushPlugin] add listener: XGPush1748838617
2016-01-04 11:54:29.059 zhanwei[501:218630] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/18492698-E8DB-4E5B-9347-8E3E4659B7B0/zhanwei.app/www/index.html#/tab/dash
2016-01-04 11:54:31.681 zhanwei[501:218630] THREAD WARNING: ['StatusBar'] took '19.081055' ms. Plugin should use a background thread.
2016-01-04 11:54:34.640 zhanwei[501:218630] THREAD WARNING: ['Geolocation'] took '32.950195' ms. Plugin should use a background thread.
以上是真机测试时打印的日志,帮我看一下,谢谢了

@rerenWorkGit
Copy link

@JrontEnd 推送是要编译成正式版的才能收到消息吗?

@JrontEnd
Copy link

JrontEnd commented Jan 4, 2016

@rerenWorkGit 我先找一个IOS8的机子测试下

@rerenWorkGit
Copy link

我是用的8.3的测试的,还是获取不到token,信鸽平台显示推送完成,有效推送2,但是一个也没收到

@JrontEnd
Copy link

JrontEnd commented Jan 4, 2016

@rerenWorkGit 我看到你的cordova原生iOS版本是3.8.0的。
2016-01-04 11:54:25.227 zhanwei[501:218630] Apache Cordova native platform version 3.8.0 is starting.
你可以升级下版本

cordova platform rm iOS
cordova platform add iOS

@rerenWorkGit
Copy link

2016-01-04 14:33:49.712 zhanwei[562:251738] Apache Cordova native platform version 3.9.2 is starting.
2016-01-04 14:33:49.714 zhanwei[562:251738] Multi-tasking -> Device: YES, App: YES
2016-01-04 14:33:49.733 zhanwei[562:251738] Unlimited access to network resources
2016-01-04 14:33:50.344 zhanwei[562:251738] [CDVTimer][splashscreen] 363.621950ms
2016-01-04 14:33:50.365 zhanwei[562:251738] [CDVTimer][statusbar] 20.561039ms
2016-01-04 14:33:50.367 zhanwei[562:251738] [XGPush] starting with access id: 2200173812, access key: IX4VAV9D989I
2016-01-04 14:33:50.386 zhanwei[562:251738] [XGPush] init for re-register
2016-01-04 14:33:50.390 zhanwei[562:251738] open sqlite db ok.
2016-01-04 14:33:50.393 zhanwei[562:251738] [CDVTimer][xgpush] 27.128041ms
2016-01-04 14:33:50.395 zhanwei[562:251738] [CDVTimer][keyboard] 0.638008ms
2016-01-04 14:33:50.396 zhanwei[562:251738] [CDVTimer][TotalPluginStartup] 415.466011ms
2016-01-04 14:33:50.637 zhanwei[562:251738] [CDVRegisterNotification] register notification
2016-01-04 14:33:50.638 zhanwei[562:251738] [CDVRegisterNotification] register ios 8
2016-01-04 14:33:50.677 zhanwei[562:251738] [XGPushPlugin] register fail
2016-01-04 14:33:50.928 zhanwei[562:251738] Resetting plugins due to page load.
2016-01-04 14:33:51.912 zhanwei[562:251738] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/F088DCB8-A121-4397-8CBC-4AE099E2E577/zhanwei.app/www/index.html#/tab/dash
2016-01-04 14:33:53.304 zhanwei[562:251738] [XGPushPlugin] registerpush:
2016-01-04 14:33:53.305 zhanwei[562:251738] [XGPush] register with token:(null) alias:
2016-01-04 14:33:53.311 zhanwei[562:251738] [xgpush error]deviceToken is nil
2016-01-04 14:33:53.312 zhanwei[562:251738] [XGPushPlugin] add listener: XGPush377686081
2016-01-04 14:33:59.252 zhanwei[562:251738] THREAD WARNING: ['Geolocation'] took '29.941162' ms. Plugin should use a background thread.
更新了ios版本
还是获取不到token

@JrontEnd
Copy link

JrontEnd commented Jan 4, 2016

@rerenWorkGit In Device, go to:
Settings->Notifications->YourApp->Enable_Notifications
不知道你开启应用的通知了没有?

@rerenWorkGit
Copy link

@JrontEnd 我看了一下,默认就是这样设置的

@JrontEnd
Copy link

JrontEnd commented Jan 4, 2016

@rerenWorkGit 推送证书分为测试和正式,你用哪个证书推送的呢?

@rerenWorkGit
Copy link

我两个都上传验证了通过了两种推送都试了

@rerenWorkGit
Copy link

@JrontEnd 信鸽平台上显示的有 有效推送量3,

@rerenWorkGit
Copy link

@JrontEnd 要不你留个邮箱,我把项目,测试证书,还有信鸽平台账号发给你,你帮我看一下,如果搞定了,我也给这个赞助一下,😄

@rerenWorkGit
Copy link

@JrontEnd 邮件我已经发到你留的邮箱了,麻烦帮我看一下。我的QQ:1009154384

@YangWenChaoTony
Copy link

ios下,设置别名没有成功,但初始化时能取到token
初始时取到的token,能否通过xgpush.deviceToken的形式取到?

@gengen1988
Copy link
Member

现在 API 里没有,期望添加一个是吧?

改成不会自动注册的,然后在新建的实例里放这个变量如何?

像这样:

var xgpush = new XGPush('app_id', 'access_key');
xgpush.registerPush('alias').then(function() {
  // 用实例变量存储 token
  console.log(xgpush.deviceToken);
});

@YangWenChaoTony
Copy link

知道别名不成功的原因不?要是改成这样,依然注册别名不成功的话咋搞,
上周中左右ios下注册别名还成功过几次,本周一次都不成功了,很奇怪。

@gengen1988
Copy link
Member

不成功会在 promise 里抛错。

另外,再试试,刚升级到最新的 SDK。

@YangWenChaoTony
Copy link

ios下依然返回token为null

@YangWenChaoTony
Copy link

你最后如何了?是怎么解决的?@rerenWorkGit

@think6ares
Copy link

我在MAC上用超级终端安装时 ,总是出现ERROR: Invalid pakeage.json,我的cordova、node、npm都是最新版的。

@zsc123400
Copy link

不知道发生了什么,这种错误出现在的概率很低,估计20次有一次会这样。其它一切都很正常。
xcode log:
2016-11-18 07:42:24.269346 医师定考[367:29747] WF: _WebFilterIsActive returning: NO
2016-11-18 07:42:29.094763 医师定考[367:29568] [XGPushPlugin] add listener: XGPush1620528205
2016-11-18 07:42:29.095414 医师定考[367:29568] [XGPushPlugin] registerPush: account = , token = (null)
2016-11-18 07:42:29.397489 医师定考[367:29568] Finished load of: http://192.168.0.182:8100/#/tab/first-page
2016-11-18 07:42:32.173460 医师定考[367:29728] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9806)
2016-11-18 07:42:46.263627 医师定考[367:29568] [XGPushPlugin] receive device token: 6a308e4a34961a4849e062c497b5c58fec381eb52ef6349fdf9b8d45f0c17a27
2016-11-18 07:42:48.662206 医师定考[367:29729] [] nw_coretls_read_one_record tls_handshake_process: [-9802]
2016-11-18 07:42:48.671951 医师定考[367:29728] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

js log:
0 145662 error ReferenceError: Can't find variable: cordova, http://192.168.0.182:8100/, Line: 1
1 149096 log [ERROR] RegisterPush: ,
2 152075 log deviceready has not fired after 5 seconds.
3 152088 log Channel not fired: onCordovaXGPushReady

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants