Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Token must be sent to both Visilabs and Euromsg servers when the user allows pushing in the mobile application. The methods to be called are as shown. OM.sys.AppID parametresine geçilecek değer euromsg panelinde oluşturulan push uygulamasının alias’ıdır.

var data = {"OM.sys.AppID" : "AppID", "OM.sys.TokenID" : "ExponentPushToken[1234567890123456789012]"};
api.customEvent("RegisterToken", data);
api.euromsg.subscribe("token");

Note: Use the following example push registration for format of ExponentPushToken[1234567890123456789012] 
async function registerForPushNotificationsAsync() {
  const { status: existingStatus } = await Permissions.getAsync(
    Permissions.NOTIFICATIONS
  );
  let finalStatus = existingStatus;

  if (existingStatus !== 'granted') {
    const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
    finalStatus = status;
  }
  
  if (finalStatus !== 'granted') {
    return;
  }

  let token = await Notifications.getExpoPushTokenAsync();
  var data = {"OM.sys.AppID" : "AppID", "OM.sys.TokenID" : token};
  api.customEvent("RegisterToken", data);
  api.euromsg.subscribe(token);
}



Parent Page: React Native

  • No labels