Skip to content

Instantly share code, notes, and snippets.

@thuliumsystems
Created April 21, 2022 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thuliumsystems/9845f6f000a7451d5e61e6b650a0d55b to your computer and use it in GitHub Desktop.
Save thuliumsystems/9845f6f000a7451d5e61e6b650a0d55b to your computer and use it in GitHub Desktop.
//pegar apenas o id do caparelho
this.oneSignal.startInit('one signal id', 'google id').endInit();
const { userId } = await this.oneSignal.getIds()
//fazer algo quando o push é recebido e quando é aberto
this.oneSignal.startInit('', '')
.handleNotificationReceived(() => {})
.handleNotificationOpened(() => {})
.endInit();
"onesignal-cordova-plugin": "^2.9.1",
"@ionic-native/onesignal": "^5.30.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment