Enabling push notifications for Library Mobile for Android
A push notification is a message that pops up on a mobile device. App publishers can send them at any time; users don't have to be in the app or using their devices to receive them. The push notification server for MicroStrategy Library Mobile is the Intelligence Server.
To enable push notification for MicroStrategy Library Mobile for Android, do the following:
- Configure Intelligence Server settings
- Configure app settings in MicroStrategy Library Mobile SDK for Android
- Get the FCM (Firebase Cloud Messaging) authentication key (optional)
In 2016, Google launched Firebase Cloud Messaging (FCM), the successor to Google Cloud Messaging (GCM). The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. If you are currently using GCM to get Android push notification, the recommendation is to modify the FCM setting in Android developer and upgrade the client version as soon as possible. This ensures seamless use of push notifications without interruption and allows you to take advantage of the new features in FCM right now.
- Open MicroStrategy Developer.
- Create a new device for the Mobile Client Android device type.
- Expand the MicroStrategy analytics modules and navigate to Administration > Delivery Managers.
- Right-click Devices and choose New > Device.
- On the Select Device Type dialog, choose Mobile Client Android and click OK.
On the Device Editor, enter the following values:
- Give the device a custom Name and an optional Description.
- Under Mobile Application, set the Package Name as something like "com.microstrategy.android.sample". The package name is the app identity name and can have whatever value you want.
- Under Firebase Cloud Messaging Service:
- Enter https://fcm.googleapis.com/fcm/send for IP Address/Server Name.
- Set the Authentication Key as the value of your FCM authentication key.
Under Firebase Cloud Messaging Proxy (optional):
If the Intelligence Server cannot communicate directly with Google FCM (Firebase Cloud Messaging), do the following;
- Select the Use Proxy checkbox.
- Enter the IP Address/Server Name for the proxy.
Click OK to save your new device.
Download google-services.json from the Firebase console.
Open google-services.json in a text editor and make the following changes:
Under "client > client_info, add a new client_id attribute and set its value to be the value of the Application ID. For example:
If you want to update google-services.json in the MicroStrategy Library for Android SDK sample project, you need to add the following line of code to build.gradle (located in the path \MicroStrategyLibraryMobile\app\build.gradle);
apply plugin: 'com.google.gms.google-services'
- Save your changes.
If you want to get the FCM authentication key, do the following:
- Open https://firebase.google.com/docs/cloud-messaging/auth-server and log in with your Google account.
- Go to your personal console.
- Create a project.
- Add a new app and configure it with corresponding package name.
- Go to app settings and click the Cloud Messaging tab.
- Click the Server Key and you will see the FCM authentication key.