Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48979

OneSignal push notification in ionic v4/v5

$
0
0

Hi Community, any one facing issue when calling onesignal library the script like skip from executed or not properly running? Because i facing some issue on onesignal that certain phone look onesignal no properly running so we cannot get the deviceid. certain phone working fine. i still don’t have clue what happen.

Below is my code.

await this.oneSignal.startInit(environment.onesignal.appId, environment.onesignal.googleProjectNumber);
this.oneSignal.setSubscription(true);
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification);
this.oneSignal.enableSound(true);
this.oneSignal.enableVibrate(true);
await this.oneSignal.endInit();

    this.oneSignal.getIds().then((data) => {
      console.log('iddddd', data);
      localStorage.setItem('fcm', data.userId);
      
    }).catch((e) => {
      console.log(e);
    }); 

thank you

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>