android-ParseInstallation保存后将deviceToken解析为空

android-ParseInstallation保存后将deviceToken解析为空,第1张

概述我正在开发一个使用Parse发送和接收通知的应用程序.现在的问题是,当我注册时,安装deviceToken为空(deviceType和installationId不为空).当此令牌为空时,我不会收到任何通知.我如何注册安装:Parse.initialize(this,"x","x");ParseInstallation.getCurrentInstallation().saveIn

我正在开发一个使用Parse发送和接收通知的应用程序.现在的问题是,当我注册时,安装devicetoken为空(deviceType和installationID不为空).当此令牌为空时,我不会收到任何通知.

我如何注册安装:

Parse.initialize(this, "x", "x");ParseInstallation.getCurrentInstallation().saveInBackground();

当我将所有解析代码添加到我的应用程序(https://www.parse.com/apps/quickstart#parse_push/android/native/existing)时,一切工作正常.

我的AndroIDManifest.xml:

<?xml version="1.0" enCoding="utf-8"?><manifest xmlns:androID="http://schemas.androID.com/apk/res/androID"    package="com.xxx.xxx" >    <uses-sdk androID:maxsdkVersion="17" />    <uses-permission androID:name="androID.permission.INTERNET" />    <uses-permission androID:name="androID.permission.ACCESS_NETWORK_STATE"/>    <uses-permission androID:name="androID.permission.WAKE_LOCK" />    <uses-permission androID:name="androID.permission.VIBRATE" />    <uses-permission androID:name="androID.permission.RECEIVE_BOOT_COMPLETED" />    <uses-permission androID:name="androID.permission.GET_ACCOUNTS" />    <uses-permission androID:name="com.Google.androID.c2dm.permission.RECEIVE" />    <permission androID:protectionLevel="signature"        androID:name="com.xxx.xxx.permission.C2D_MESSAGE" />    <uses-permission androID:name="com.xxx.xxx.permission.C2D_MESSAGE" />    <application        androID:name="com.xxx.xxx.name_"        androID:allowBackup="true"        androID:icon="@drawable/ic_launcher"        androID:logo="@drawable/ic_launcher"        androID:label="@string/app_name"        androID:theme="@style/Apptheme" >        <Meta-data            androID:name="com.Google.androID.gms.analytics.globalConfigResource"            androID:resource="@xml/global_tracker" />        <activity            androID:name="com.xxx.xxx.ActivitIEs.SplashActivity_"            androID:screenorIEntation="portrait"            androID:label="@string/app_name" >            <intent-filter>                <action androID:name="androID.intent.action.MAIN" />                <category androID:name="androID.intent.category.LAUNCHER" />            </intent-filter>        </activity>        <activity            androID:name="com.xxx.xxx.ActivitIEs.LoginActivity_"            androID:screenorIEntation="portrait"            androID:label="@string/app_name" >        </activity>        <activity            androID:name="com.xxx.xxx.ActivitIEs.ForgotPassword_"            androID:screenorIEntation="portrait"            androID:label="@string/app_name">        </activity>        <activity            androID:name="com.xxx.xxx.ActivitIEs.MainActivity_"            androID:screenorIEntation="portrait"            androID:label="@string/app_name" >        </activity>        <activity            androID:name="com.xxx.xxx.ActivitIEs.EditProfile_"            androID:screenorIEntation="portrait"            androID:label="@string/edit_profile" >        </activity>        <receiver androID:name="com.Google.androID.gms.analytics.AnalyticsReceiver"            androID:enabled="true">            <intent-filter>                <action androID:name="com.Google.androID.gms.analytics.ANALYTICS_disPATCH" />            </intent-filter>        </receiver>        <service androID:name="com.Google.androID.gms.analytics.AnalytiCSService"            androID:enabled="true"            androID:exported="false"/>        <service androID:name="com.parse.PushService" />        <receiver androID:name="com.parse.ParsebroadcastReceiver">            <intent-filter>                <action androID:name="androID.intent.action.BOOT_COMPLETED" />                <action androID:name="androID.intent.action.USER_PRESENT" />            </intent-filter>        </receiver>        <receiver androID:name=".Receiver.MyPushbroadcastReceiver"            androID:exported="false">            <intent-filter>                <action androID:name="com.parse.push.intent.RECEIVE" />                <action androID:name="com.parse.push.intent.DELETE" />                <action androID:name="com.parse.push.intent.OPEN" />            </intent-filter>        </receiver>        <receiver androID:name="com.parse.GcmbroadcastReceiver"            androID:permission="com.Google.androID.c2dm.permission.SEND">            <intent-filter>                <action androID:name="com.Google.androID.c2dm.intent.RECEIVE" />                <action androID:name="com.Google.androID.c2dm.intent.REGISTRATION" />                <category androID:name="com.xxx.xxx" />            </intent-filter>        </receiver>    </application></manifest>

我刚刚创建了一个新应用程序,添加了Parse并删除了Parse中的Installation类/表,但仍然没有devicetoken.

解决方法:

我认为这是新的Parse SDK中的错误.我降级到1.9.0,现在一切正常.

来源:https://groups.google.com/forum/#!topic/parse-developers/a1Z0SSC304M

总结

以上是内存溢出为你收集整理的android-ParseInstallation保存后将deviceToken解析为空全部内容,希望文章能够帮你解决android-ParseInstallation保存后将deviceToken解析为空所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1089777.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存