Sticky mpknowledgedrop

Use Android SDK to Send Push Notifications in Unity

  • 5 February 2020
  • 0 replies
  • 302 views
Use Android SDK to Send Push Notifications in Unity
Userlevel 6
Badge +4

Every week, we will release tips to help you get the most out of Mixpanel. Want to see more? Click here to see other #mpknowledgedrop articles.

 

Unfortunately, the not so great news is that Android push notifications are not supported through Mixpanel Unity’s library or through the Unity Notification Services class. This is a known product gap and it is something that we are considering but currently, there is no set timeline on when this will be created. 

 

The GOOD news is that it is possible to use our Android SDK as a wrapper to send push notifications! Please note that this will require some technical work on your end. 

 

To set this up, you can make an Android Unity plugin that wraps Mixpanel Android SDK, to then be called from within C# code. Also, you will need to be sure that the project ID and API key match in the Google Developer Console. 

 

Watch out for errors such as mismatchSenderID when trying to send a push notification. A mismatchSenderID error is generally due to using one project ID to generate the device token and another project's API key to send the push. If you try to target a user with the push notification and receive the 'MismatchSenderId' error, you will notice a new user property that lists an invalid Android device token. Removing inactive Android Push Tokens, unlike iOS, inactive Android push tokens are removed automatically, so there is no need to go through a process of manually removing them.

 

You can find more information on how to locate your Google API key here - https://developer.mixpanel.com/docs/android-push-notifications#section-uploading-your-google-api-key-to-mixpanel 

 

You can read more Android Push Notifications and common errors in the following article, https://help.mixpanel.com/hc/en-us/articles/115004690166-Push-Token-Management-For-Inactive-Or-Invalid-Tokens#android-push-tokens

 

Hope this workaround helps get your push notifications working with Unity!


0 replies

Be the first to reply!

Reply