Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Kullanıcı mobil uygulamada push gönderimine izin verdiğinde token’ın hem Visilabs hem de Euromsg sunucularına gönderilmesi gerekmektedir. Çağrılması gereken metodlar aşağıdaki gibidir. OM.sys.AppID parametresine geçilecek değer euromsg panelinde oluşturulan push uygulamasının alias’ıdırToken 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. The value to be passed to the OM.sys.AppID parameter is the app alias of the push application created in the euromsg panel.


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

...


Code Block
languagejava
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 (Expo) Visilabs Implementation