Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add push notification tutorial (blog.vverh.digital)
<platform name="android">
<preference name="AndroidXEnabled" value="true" />
</platform>
<platform name="android">
<preference name="AndroidXEnabled" value="true" />
<resource-file src="res/google-services.json" target="app/google-services.json" />
</platform>
<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>
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