I have added this to capacitor.config.json file
"PushNotifications": {
"presentationOptions": [
"badge", "sound", "alert"
]
}
but it not work please help me
Related
I am developing hybrid app for Android using Ionic 5 in local environment and so I tried to set up the proxy config as following below.
In command line
$ ionic config set proxy http://myserver.com
changed ionic.config.json file:
{
"name": "appName",
"integrations": {
"capacitor": {},
"cordova": {}
},
"type": "angular",
"proxy": "http://myserver.com"
}
But it didn't work and please help me with this issue.
Note:
I know already proxy configuration for Angular project as below, but it didn't work in Android app.
"options": {
"browserTarget": "app:build",
"proxyConfig": "proxy.conf.json"
}
I have a react-native app with multiple environments.
Dev, prod, ... Which means that I have multiple 'copies' of the app installed on the phone App Dev, App Prod.
These are under a different bundle identifier:
com.myapp.dev
com.myapp.prod
I use deep links to open the app, this works perfect on Android because it asks with which app you want to open it, but on iOS it just opens the first app that founds installed 😞 and i can't find the way to, for example:
Launch develop-app://whatever/1 and open it in the Dev app
Launch prod-app://whatever/1 and open it in the Prod app
What am i missing?
This are my defined url types:
Also the apple-app-site-association file looks like this:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234.com.myapp.dev",
"paths": ["*"]
},
{
"appID": "1234.com.myapp.prod",
"paths": ["*"]
}
]
}
}
Update
The first problem that i found was that the apple-app-site-association wasn't using a Content-Type header, so, the app could not recognize the file.
The paths that each environment should recognize should be defined:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234.com.myapp.dev",
"paths": ["/dev/*"]
},
{
"appID": "1234.com.myapp.prod",
"paths": ["/prod/*"]
}
]
}
}
Now i'm able to see the banner on the top of the website Open with App Dev as expected
You have to specify which path is to be opened by which app
For example, your domain is example.com
You have to specify a different path pattern for both dev & prod app in your apple-app-site-association file
For example, you can update your apple-app-site-association file as shown below
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234.com.myapp.dev",
"paths": ["/dev/*"]
},
{
"appID": "1234.com.myapp.prod",
"paths": ["/prod/*"]
},
]
}
}
Now, let us say you click on the urls below, you'll be directed to mentioned app in the comments
https://example.com/dev/123?id=3 // Opens dev app
https://example.com/dev?id=2 // Opens dev app
https://example.com/prod/123 // Opens prod app
https://example.com/prod // Opens prod app
https://example.com/prod/123?name=john // Opens prod app
I've been trying to configure push-proxy on my server.i have done complete installation from here
mattermost-push-proxy
After installation my server is running but when i want to test notification from curl
curl http://172.104.182.36:8066/api/v1/send_push -X POST -H "Content-Type: application/json" -d '{ "message":"test", "badge": 1, "platform":"android", "server_id":"c5brhfxaeb8o3qkcc3dfc47coy", "device_id":"android:el99uTDjv0A:APA91bGnVbuZl9W2lQSSokXYECVa4Tgt-wrnOxQFh4r51pzdDaFxbXUrJXQgmcSaPYToyIA5Dc9CCLPvYPNBF8bnrZdCjOSIaJmgB0Uhusj-8IoVCtFfAkF_l_PfRq0TMQf7L_RYMLqo"}'
I got this error:
{"error":"unknown transport error","status":"FAIL"}
please help me.
thanks
First ensure that your config file has the appropriate certificates and ApiKeys like:
{
"ListenAddress":":8066",
"ThrottlePerSec":300,
"ThrottleMemoryStoreSize":50000,
"ThrottleVaryByHeader":"X-Forwarded-For",
"EnableMetrics": false,
"ApplePushSettings": [
{
"Type" : "apple_rnbeta",
"ApplePushUseDevelopment": false,
"ApplePushCertPrivate": "./config/aps_rnbeta_production_priv.pem",
"ApplePushCertPassword": "",
"ApplePushTopic": "com.mattermost.rnbeta"
},
{
"Type" : "apple",
"ApplePushUseDevelopment": false,
"ApplePushCertPrivate": "./config/aps_rn_production_priv.pem",
"ApplePushCertPassword": "",
"ApplePushTopic": "com.mattermost.rn"
}
],
"AndroidPushSettings": [
{
"Type" : "android_rn",
"AndroidApiKey": "AIzaSyA1sl9LXXXxXXXxXXXxXXXxX_XXXXXX"
},
{
"Type" : "android",
"AndroidApiKey": "AIzaSyA1sl9LXXXxXXXyXXXxXXXyX_XXXXYY"
}
]
}
That being said just because you are using your own push-proxy server you need to build and compile the apps yourself so that the above certificates and Android ApiKeys match with your registered device tokens.
when building the app yourself don't forget to change the bundleId on iOS and packageId on Android so they also match with your certificates and keys.
I'm developing an Ionic (version 1.3.1) application and trying use Ionic push.
The application is correctly registering to ionic server but I still don't receive any notification in my device. The only error I get is the below notification status:
{
"notification": "808cde89-eb21-40d7-9999-b86e5f86f1d3",
"token": {
"type": "android",
"token": "dkYxYGcKeNo:APA91bE4OXhzkOUOSF1EsXxgY9Cd0Uu9-A98Ak5prdMIGUd10tLljacgKs7zAp1WPLF-bDiy3pkdroc9l8vWy4sXdfansr56-rIF59wJfR1e7EibJZHFO5DFxCThpT_ZgVn_T_0n8an1",
"id": "ea40d3bc7561cc4f0d28ac49ce87fd3a",
"app_id": "7ab91503",
"invalidated": null,
"created": "2016-09-17T11:31:53.481151+00:00",
"valid": true
},
"uuid": "0ebe9454-aebc-4c0b-b5b0-056920817f56",
"status": "error",
"error": "GCM_INVALID_AUTH",
"created": "2016-09-17T14:31:20.517783+00:00",
"user_id": null
}
I'm supposing ionic server is not sending the notification to device as the status is error, but I don't know the reason why I'm getting this GCM_INVALID_AUTH error. What could cause this problem?
You need migrate your project from GCM to FCM (firebase cloud message) , and use new server key.
SOLVED
I was using the wrong credentials from Google Cloud Platform. When I set to server key the problem was solved.
I face a weird Ionic2 behaviour.
When i deploy my app to a simulator, i can see the .ts file sourceMap in the chrome inspect debugger.
On both case, i use :
ionic run android
On the other side, when i deploy my apk on a real device, the tab "Sources" is completely different with an other groups of directories and, with no reference to my .ts files.
My environment is:
OS X 10.11
Ionic 2 2.0.0-beta.35
cordova 6.3.0
The project has been initially generated by:
ionic start biblio tutorial --v2
ionic.config.json
{
"name": "biblio",
"app_id": "",
"v2": true,
"typescript": true
}
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"filesGlob": [
"**/*.ts",
"!node_modules/**/*"
],
"exclude": [
"node_modules",
"typings/global",
"typings/global.d.ts"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
Any ideas?
For me the problem was that when you're remote debugging on an android device, Chrome debugger cannot access the source map file on the device. The solution/fix is to include the source map inline. To do this I:
added the below to package.json in the root project directory
"config": {
"ionic_bundler": "webpack",
"ionic_source_map_type": "#inline-source-map"
},
This is to make the webpack to add source maps inline changed tsconfig.js line
"sourceMap": true,
to
"sourceMap": false
This is to disable typescript to create source map file since this is done by webpack.
After this change everything seems to be working fine. Note that this applies to ionic 2 RC_04