GCM app registration token Is Invalid

I'm trying to register my xamarin android app for push notification with google cloud messages. I'm able to get the registration token for my app using a test phone. However, once I test the registration token validity with GCM using this get method
/ *
https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=MY_DEVICE_TOKEN
*/
, response is always
{
"error": "invalid_token",
"error_description": "Invalid Value"
}
I'm have use this plugin and the sample code from xamarin. In both cases, the result is the same response as above. The token obtained after registering the app is always tagged as invalid by GCM.

Best Answer

Answers

  • mrklintschermrklintscher DEMember ✭✭
    edited July 2016

    Do you set permission in manifest?

  • CodeSharpCodeSharp USMember

    @mrklintscher said:
    Do you set permission in manifest?

    Hi, yes i did, this is my manifest.

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
              package="my.com.canaan.test.android.notification_2" 
              android:versionCode="1" android:versionName="1.0" 
              android:installLocation="auto">
        <uses-sdk android:minSdkVersion="16" />
        <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
        <uses-permission android:name="android.permission.WAKE_LOCK" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="my.com.canaan.test.android.notification_2.permission.C2D_MESSAGE" />
        <permission android:name="my.com.canaan.test.android.notification_2.permission.C2D_MESSAGE" 
                  android:protectionLevel="signature" />
        <application android:label="RemoteNotification" android:icon="@drawable/Icon"></application>
    </manifest>
    
Sign In or Register to comment.