question

Lukasz Borun avatar image
Lukasz Borun asked

Problem with Android Push Register

Hi, 

I have problem with register device for token. I successful configured iOS and Android APN. When i want to register a device with that code:

PlayFabGoogleCloudMessaging._RegistrationReadyCallback += RegistrationReadyCallback;
PlayFabGoogleCloudMessaging._RegistrationCallback += RegistrationCallback;
PlayFabGoogleCloudMessaging._MessageCallback += OnPushReceived;
PlayFabAndroidPlugin.Init(sender_id);

the event _RegistrationReadyCallback never callback. 

I use latest PlayFabSDK for Unity3D

Ps. There are only logs for GCM:
03-25 14:28:45.570: I/PlayFabUAP(18917): PlayFab GCM Init, saving prefs.
03-25 14:28:45.570: I/PlayFabUAP(18917): Setting SenderId: xxxxxxxxx (my sender_id)
03-25 14:28:45.570: I/PlayFabUAP(18917): PlayFabUnityAndroidPlugin Service, Binding to Unity Activity


Thanks.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Lukasz Borun avatar image
Lukasz Borun answered

Hi Zac!

I got Device Token received by other plugin. I registered with PlayFabAPI that Token, and sent via postman a push notification. I successful received that notification and app displayed it. 

I manually merged AndroidManifest. In Your default AndroidManifest You have some acitivity like this:

<service android:name=".GCM.PlayFabGcmListenerService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
</intent-filter>
</service>

 

I had a cash. Class PlayFabInstanceIDListenerService didn't found. 
When i change it to

<service android:name="com.playfab.unityplugin.GCM.PlayFabGcmListenerService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
</intent-filter>
</service>

Everything start working. 


Ps. Still can't received DeviceToken by Your API but solved this with another plugin. 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

Hey Lukasz,

I am glad that you were able to get unblocked and sorry that you were never able to get the device token from our plugin. We will be looking into the information you provided to improve our plugin.

 

Thanks,

Zac

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

casticonstantinescu@gmail.com avatar image
casticonstantinescu@gmail.com answered

Even using your examples posted, it also fails. This is found in adb.exe logcat logs, right after the call to Init:

 (built using https://github.com/PlayFab/UnitySDK/blob/master/ClientExamples/PushNotificationExample.unitypackage . Note, I had to remove some code because there are unresolved issues to Linq in the on message received handler, but the rest was left intact). 

 

W/ActivityManager(  509): Unable to start service Intent { cmp=com.********/com.playfab.unityplugin.PlayFabUnityAndroidPlugin } U=0: not found
I/PlayFabUAP(19603): PlayFabUnityAndroidPlugin Service, Binding to Unity Activity
W/ActivityManager(  509): Unable to start service Intent { cmp=com.*********/com.playfab.unityplugin.PlayFabUnityAndroidPlugin } U=0: not found
D/Raydium_ts_main(  180): Report rate in 10 seconds =501

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

Lukasz, casticonstantinescu,

After much digging, it turns out Google changed they way push plugins need to be built. We have completed the rebuild and will be uploading the asset package after we complete testing & documenting.

Thanks for being patient, Google really caught us by surprise on this one.  

You will be able to find the plugin in our UnitySDK gitHub repo; also, I will post back here after our plugin goes live.

-Zac

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

casticonstantinescu@gmail.com avatar image
casticonstantinescu@gmail.com answered

Hi Zac any idea when I can pull an update or clone one of your repos that has the changes applied

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Zac Bragg avatar image
Zac Bragg Deactivated answered

We do not have a fixed release date; however, this should be available next week. 

 

-Zac

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

maximelaffaire avatar image
maximelaffaire answered

Hi,

I have the exact similar problem described in the main subject. However since the post date back some months ago I guess the plugin is now functionnal. I'm using the last version of playfab and the last version of the android plugin. I did not try yet to get the token from another plugin, I would like to get it works entirely with playfab's plugins.

Thanks

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Yes, the plugin has been updated. Can you let us know the version number of the SDK and plugin you're using?

0 Likes 0 ·
maximelaffaire avatar image maximelaffaire brendan commented ·

It was the latest, 2.12.161107 . We fixed the problem by using directly the firebase API to get the token, and it's working fine now, but we couldn't figure out why it wasn't working with the playfab plugin

0 Likes 0 ·
brendan avatar image brendan maximelaffaire commented ·

Thanks - our tools team is checking on this now, and will update shortly.

0 Likes 0 ·
Marco Williams avatar image
Marco Williams answered

@maximelaffaire please review the video here: https://www.youtube.com/watch?v=f6RFXrlSlmw&t=350s it shows how to setup push notifications end to end with our plugin.

If you are getting the token through the firebase API (on your own) then most likely you have disabled our plugin in your manifest ( total guess here ) and / or something else is wrong. Without seeing your project or your manifest I have no way to tell. If you post your manifest and or code then we can take a look at it. But really you should just follow the video tutorial and it should work out of the box for you.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fred avatar image
Fred answered

We had the same issue because we installed Play Game Plugin for Unity


Using Playfab notification plugins and Google play service causes version incompatibilities in .jar and .aar files (which is quite problematic), we uninstalled Google Play Game Service in order to have notification, but we still working on the issue to identify what really cause this.


Because of that our homemade Social, Achievement and Quest systems aren't working at 100%, we will post again when we have more details.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.