public class SinchHelpers
extends java.lang.Object
Constructor and Description |
---|
SinchHelpers() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isGooglePlayServicesAvailable(android.content.Context context) |
static boolean |
isHuaweiMobileServicesAvailable(android.content.Context context) |
static boolean |
isSinchPushIntent(android.content.Intent intent)
Deprecated.
|
static boolean |
isSinchPushPayload(java.util.Map<java.lang.String,java.lang.String> payload)
Inspects the
intent to decide if it might be intended for a SinchClient . |
static NotificationResult |
queryPushNotificationPayload(android.content.Context context,
java.util.Map<java.lang.String,java.lang.String> payload)
Method used to parse push payload and retrieve partially validated NotificationResult mainly to
provide a way to check custom public headers that came with push message before deciding how to
process the message and whether to start Sinch client at all.
|
@Deprecated public static boolean isSinchPushIntent(android.content.Intent intent)
intent
to decide if it might be intended for a SinchClient
.intent
- Intent received from a FCM receiverpublic static boolean isSinchPushPayload(java.util.Map<java.lang.String,java.lang.String> payload)
intent
to decide if it might be intended for a SinchClient
.payload
- Data received with a FCM RemoteMessagepublic static NotificationResult queryPushNotificationPayload(android.content.Context context, java.util.Map<java.lang.String,java.lang.String> payload)
SinchClient.relayRemotePushNotificationPayload(java.lang.String)
, but a HELPER
method with limited functionality.
Intended use in FCM listener service:
public void onMessageReceived(RemoteMessage remoteMessage){
Map data = remoteMessage.getData();
if (SinchHelpers.isSinchPushPayload(data)) {
Map<String,String>
headers = SinchHelpers.queryPushNotificationPayload(context, data).getCallResult().getHeaders();
...
}
...
context
- Application context to load native libraries used for payload parsing.payload
- Payload received from a FCM RemoteMessage dataisSinchPushPayload(java.util.Map)
,
NotificationResult.getCallResult()
,
CallNotificationResult.getHeaders()
public static boolean isGooglePlayServicesAvailable(android.content.Context context)
public static boolean isHuaweiMobileServicesAvailable(android.content.Context context)
Copyright 2016, Sinch AB