Last active
May 6, 2021 07:03
-
-
Save Maxim-Kolmogorov/55fff188611a91e1d9e8f5c6afbe7bb5 to your computer and use it in GitHub Desktop.
Add push notification tutorial (blog.vverh.digital)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<platform name="android"> | |
<preference name="AndroidXEnabled" value="true" /> | |
</platform> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<platform name="android"> | |
<preference name="AndroidXEnabled" value="true" /> | |
<resource-file src="res/google-services.json" target="app/google-services.json" /> | |
</platform> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resource-file src="res/drawable/drawable-anydpi-v24/notification_icons.xml" target="app/src/main/res/drawable-anydpi-v24/notification_icons.xml" /> | |
<resource-file src="res/drawable/drawable-hdpi/notification_icons.png" target="app/src/main/res/drawable-hdpi/notification_icons.png" /> | |
<resource-file src="res/drawable/drawable-mdpi/notification_icons.png" target="app/src/main/res/drawable-mdpi/notification_icons.png" /> | |
<resource-file src="res/drawable/drawable-xhdpi/notification_icons.png" target="app/src/main/res/drawable-xhdpi/notification_icons.png" /> | |
<resource-file src="res/drawable/drawable-xxhdpi/notification_icons.png" target="app/src/main/res/drawable-xxhdpi/notification_icons.png" /> | |
<config-file target="AndroidManifest.xml" parent="/manifest/application"> | |
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icons" /> | |
</config-file> | |
<!-- And finally, add this dependency in tag <widget>: --> | |
<widget ... xmlns:android="schemas.android.com/apk/res/android" ...></widget> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.pushNotification.registration( | |
(token) => { | |
console.log(token); | |
}, | |
(error) => { | |
console.error(error); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment