Skip to content

Enabling OneSignal notifications

Sarsa Murmu edited this page Jul 1, 2024 · 5 revisions

OneSignal can be used to send your users notifications.

1. Getting OneSignal App ID

  • First create a OneSignal app
  • Now open your app in the OneSignal dashboard
  • Open settings
  • Switch to Keys & IDs tab
  • Copy your OneSignal App ID

2. Setting up your app

Setting up build.gradle

  • Open your app's build.gradle (app/build.gradle or build.gradle (Module: app))
  • Find this line (around line 56) and remove // (double slash)
    //implementation 'com.onesignal:OneSignal:[5.0.0, 5.99.99]'
    
  • Sync Gradle

Setting up CandyBar.java

  • Open app/src/main/java/.../applications/CandyBar.java
  • Go to line 6 and you will find //import, remove // (double slash)
  • Go to line 15 and 22 and remove /* and */
  • On line 20, replace YOUR_ONESIGNAL_APP_ID with your OneSignal App ID
  • Go to line 36 and 44 and remove /* and */

OneSignal notification is now enabled in your app. Go and send some notifications ;)

Clone this wiki locally