-
-
Notifications
You must be signed in to change notification settings - Fork 138
Enabling notifications
This feature is completely optional. If you don't want to implement this, you can just ignore the content of this page.
Note
OneSignal collects some data, and this should be reflected in the “Data safety” section of your app’s Play Store listing. In the Play Console, declare that your app collects data of the “Device or other IDs” type. See the OneSignal documentation and the Play Console documentation for more information.
-
Create an account on OneSignal.
-
Generate the required API keys following this tutorial.
-
Open this file:
app/build.gradle
-
Just so you know, the comment marks are these:
/*
and*/
and//
-
Do NOT sync gradle until you reach step 8. This is important.
-
Check these lines and remove the comments in them:
Careful! When you remove lines, the lines numbers will change, but you can easily find them by the comment marks.
-
Open the file
buildSrc/src/main/java/OneSignal.kt
-
You can now sync gradle
-
Go to this file:
app/src/main/kotlin/your/package/name/NotificationServiceExtension.kt
and remove the comment marks at lines3
and29
. -
Go to this file:
app/src/main/kotlin/your/package/name/MyApplication.kt
and remove the comment marks at lines6
,7
,8
,14
and26
. -
Clean and rebuild your project.
-
Run your app and test notifications from OneSignal's console.
-
If you want to change your notifications icon, just create a Vector Drawable XML icon and put it inside this folder:
app/src/main/res/drawable
with the nameic_notification.xml
.
Wiki written by Patryk Goworowski, Lumiq Creative, and Jackson Hayes. Special thanks to Sanchith Hegde. Copyright © 2018 Jahir Fiquitiva.
Licensed under the CreativeCommons Attribution-ShareAlike 4.0 International License. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://creativecommons.org/licenses/by-sa/4.0/legalcode.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- Get Started
- Set Basic Values
- Create a Package
- Set App Name
- Set App Icon
- Set Launch Screen Image
- Set App Colours
- Change Store & License Settings
- Setting
blueprint_setup.xml
up - Setting
kuper_setup.xml
up - Setting
frames_setup.xml
up - Setting custom styles
- Adding Zooper widgets
- Adding Kustom assets
- Setting up Credits
- Optimize your wallpapers
- Setting up the wallpapers JSON file
- Enabling notifications
- Setting up the icon pack (1/2)
- Setting up the icon pack (2/2)
- Add support for Smart Launcher
- Update your app's changelog