Parse deviceToken empty after saving ParseInstallation

I am working on an application where I am using Parse to send and receive notifications. Now the problem is that when registering the device, the installToken is empty (deviceType and installationId are not empty). When this token is empty, I cannot receive any notifications.

How do I register the installation:

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

      

When I added all the Parse code to my app ( https://www.parse.com/apps/quickstart#parse_push/android/native/existing ) everything was fine.

My 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>

      

I just created a new app, added Parse and removed the setup class / table in Parse, but still no deviceToken was set.

+3


source to share


1 answer


I think this is a bug in the new Parse SDK. I downgraded the rating to 1.9.0 and now everything works fine.



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

+4


source







All Articles