Hey [~b1zzu] I don't know if I did something different but I don't get the problem. Here is the step by step I did.
0. Check the Cordova version {code} cordova -v 9.0.0 (cordova-lib@9.0.1) {code}
1. Create the project
{code} cordova create $APP_FOLDER $APP_PACKAGE "$APP_NAME" cd $APP_FOLDER {code}
2. Add plugins / libraries
{code} cordova plugin add cordova-plugin-device cordova plugin add @aerogear/cordova-plugin-aerogear-push npm i @aerogear/app npm i @aerogear/push npm i webpack --save-dev npm i webpack-cli --save-dev {code}
3. Add resource-file on config.xml inside of <platform name="android"> {code} <resource-file src="google-services.json" target="app/google-services.json" /> {code}
4. Add usesCleartextTraffic on config.xml inside of <platform name="android">
{code} <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application"> <application android:usesCleartextTraffic="true"/> </edit-config> {code}
5. Provides the google-services.json
5 6 . Create a webpack.config.js {code} const path = require('path');
module.exports = { mode: 'development', entry: './src/index.js', output: { filename: 'index.js', path: path.resolve(__dirname, 'www/js') } }; {code}
6 7 . Provides the mobile-config.json
7 8 . Run the webpack {code} ./node_modules/webpack/bin/webpack.js {code}
8 9 . Adding Cordova platforms
{code} cordova platform add android {code}
9 10 . Build the app {code} cordova build android {code}
10 11 . Check the AndroidManifest.xml
{code} cat platforms/android/app/src/main/AndroidManifest.xml <?xml version='1.0' encoding='utf-8'?> <manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="org.aerogear.helloworldpush.testing" xmlns:android="http://schemas.android.com/apk/res/android"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true"> <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize"> <intent-filter android:label="@string/launcher_name"> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" android:permission="${applicationId}.permission.PushHandlerActivity" /> <receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler" /> <receiver android:name="com.adobe.phonegap.push.PushDismissedHandler" /> <service android:name="com.adobe.phonegap.push.FCMService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> </application> <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.VIBRATE" /> </manifest> {code} |
|