Coder Social home page Coder Social logo

onesignal-cordova-example's Introduction

OneSignal Cordova Example

An example Cordova app with the OneSignal plugin intergated showing how to use each of its functions.

Trying the Example Out!

  1. To build the example first run cordova platform add android and/or cordova platform add ios.
  2. Open www\js\index.js and replace "3beb3078-e0f1-4629-af17-fde833b9f716" with your OneSignal App Id.
  3. Build and run the app on your device with cordova run android or cordova run ios.

Installing in Your Own Project

To add the OneSignal to your Cordova project run the following. cordova plugin add onesignal-cordova-plugin --save

See the OneSignal Cordova SDK Setup Guide for the full installation guide.

Using Ionic instead?

onesignal-cordova-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onesignal-cordova-example's Issues

Xcode Build fails "library not found for -lPods-OneSignalExample"

image
image

@jkasten2 The build fails on Xcode with this Cordova app example.
Here is the error :
ld: library not found for -lPods-OneSignalExample

Do you know a way to resolve it ? Thanks a lot for your help !

Info: command cd platforms/ios/cordova && npm install ios-sim@latest && cordova run ios --target "iPhone-X, 12.4" works great, the simulator starts and i can test the example. It doesn't only with Xcode interface, weird.

OneSignal Cordova Not Working with Android Api 29

Description:

I am not able to build Ionic 5 app with OneSignal plugin. It works with [email protected] (Android target: android-28) but it does not work with [email protected] (Android target: android-29).

Environment

  1. OneSignal: 2.11.1
  2. Cordova platform: android 9.0.0
  3. Android target: android-29

Anything else:

Configure project :app
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!

Task :app:mergeDebugResources
OneSignalPlugin: WARNING: OneSignalPlugin: Downgraded 'com.android.support:23+' ->
28 to prevent compile errors! Recommend updating your project's compileSdkVersion!
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.android.support:support-v4:28.
Searched in the following locations:

Could not find com.android.support:support-annotations:28.
Searched in the following locations:

Could not find com.android.support:appcompat-v7:28.
Searched in the following locations:

Could not find com.android.support:support-v4:28.
Searched in the following locations:

Could not find com.android.support:cardview-v7:28.
Searched in the following locations:

Could not find com.android.support:support-fragment:28.
Searched in the following locations:

Could not find com.android.support:customtabs:28.
Searched in the following locations:

Could not find com.android.support:support-annotations:28.
Searched in the following locations:

Could not find com.android.support:support-core-utils:28.
Searched in the following locations:

Could not find com.android.support:support-v4:28.
Searched in the following locations:

Could not find com.android.support:appcompat-v7:28.
Searched in the following locations:

Could not find com.android.support:cardview-v7:28.
Searched in the following locations:

Could not find com.android.support:customtabs:28.
Searched in the following locations:

Could not find com.android.support:support-v4:28.
Searched in the following locations:

┆Issue is synchronized with this Asana task by Unito

ERROR: HTTP Request (OSRequestRegisterUser) must contain app_id parameter

Description:

I have the same code on Android and it works fine. On iOS, 90% of the times I get these errors:

ERROR: HTTP Request (OSRequestRegisterUser) must contain app_id parameter

Request <OSRequestRegisterUser: 0x283c918c0> fail result error Error Domain=OneSignalError Code=-1 "(null)" UserInfo={error=HTTP Request (OSRequestRegisterUser) must contain app_id parameter}

ERROR: Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=-1 "(null)" UserInfo={error=HTTP Request (OSRequestRegisterUser) must contain app_id parameter}

ERROR: Encountered error during email registration with OneSignal: (null)

Environment
Cordova 9.0.0
Ionic 6.2.0
XCode: 11.3.1
iPhone model: 6s
iOS version of device: 13.3.1

Plugin list:
cordova-background-geolocation-lt 3.4.2 "BackgroundGeolocation"
cordova-plugin-background-fetch 5.6.1 "CDVBackgroundFetch"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.4.1 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
onesignal-cordova-plugin 2.8.4 "OneSignal Push Notifications"

Steps to Reproduce Issue:

  1. Add the onesignal-cordova-plugin to your project
  2. ionic cordova platform rm ios -> ionic cordova platform add ios -> ionic cordova prepare ios
  3. Open XCode and make sure you have Push Notifications enabled and then build in a real device.
  4. Watch the logs in XCode

┆Issue is synchronized with this Asana task by Unito

IOS not receiving push token ( Apns Delegate Never Fired )

Push subscription state changed: { "to": { "userSubscriptionSetting": true, "subscribed": false, "userId": "75de1a6e-b81b-45bd-8d38-0a6c3e8d3644", "pushToken": null }, "from": { "userSubscriptionSetting": true, "subscribed": false, "userId": null, "pushToken": null } }

Could not resolve com.google.android.gms:play-services-base

Description:
I have an error when running cordova build after adding the OneSignal Cordova SDK. It seems to be looking in the wrong place for GMS libraries.

There is a demo of this on github at https://github.com/mikebridge/CordovaOneSignalProblem

$ cordova build
=>
...
Could not resolve com.google.android.gms:play-services-base:[15.0.0, 16.0.0).
  Required by:
      project :app > com.onesignal:OneSignal:3.15.1
 ... (full details below)

Environment

$ cordova --version
9.0.0 ([email protected])

Steps to Reproduce Issue:

mkdir cordova_test
cd cordova_test
cordova create hello com.example.hello HelloWorld
cd hello/
cordova platform add android
cordova plugin add @iotize/device-com-nfc.cordova
cordova build # <- this works
cordova plugin add onesignal-cordova-plugin --save
cordova build # <- now this doesn't work

FULL ERROR

cordova build
=>
$ cordova  build

Monetize your app with AdMob ads. Now available with this cordova / phonegap plugin:
cordova plugin add cordova-admob
Docs: https://github.com/appfeel/admob-google-cordova

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/home/bridge/Android/Sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app

> Configure project :app
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
   Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!

> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest UP-TO-DATE
> Task :CordovaLib:processDebugManifest UP-TO-DATE
> Task :app:preDebugBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-base:[15.0.0, 16.0.0).
  Required by:
      project :app > com.onesignal:OneSignal:3.15.1
   > Failed to list versions for com.google.android.gms:play-services-base.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'. Received status code 401 from server: Unauthorized
> Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
  Required by:
      project :app > com.google.android.gms:play-services-location:15.0.1
   > Failed to list versions for com.google.android.gms:play-services-base.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'. Received status code 401 from server: Unauthorized
> Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
  Required by:
      project :app > com.google.android.gms:play-services-location:15.0.1
      project :app > com.google.android.gms:play-services-places-placereport:15.0.1
   > Failed to list versions for com.google.android.gms:play-services-basement.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-basement/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-basement/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-basement/maven-metadata.xml'. Received status code 401 from server: Unauthorized
> Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
  Required by:
      project :app > com.google.android.gms:play-services-location:15.0.1
   > Failed to list versions for com.google.android.gms:play-services-tasks.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-tasks/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-tasks/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-tasks/maven-metadata.xml'. Received status code 401 from server: Unauthorized

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
3 actionable tasks: 1 executed, 2 up-to-date
/home/bridge/work/cordova_test/hello/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-base:[15.0.0, 16.0.0).
  Required by:
      project :app > com.onesignal:OneSignal:3.15.1
   > Failed to list versions for com.google.android.gms:play-services-base.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'. Received status code 401 from server: Unauthorized
> Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
  Required by:
      project :app > com.google.android.gms:play-services-location:15.0.1
   > Failed to list versions for com.google.android.gms:play-services-base.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-base/maven-metadata.xml'. Received status code 401 from server: Unauthorized
> Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
  Required by:
      project :app > com.google.android.gms:play-services-location:15.0.1
      project :app > com.google.android.gms:play-services-places-placereport:15.0.1
   > Failed to list versions for com.google.android.gms:play-services-basement.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-basement/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-basement/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-basement/maven-metadata.xml'. Received status code 401 from server: Unauthorized
> Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
  Required by:
      project :app > com.google.android.gms:play-services-location:15.0.1
   > Failed to list versions for com.google.android.gms:play-services-tasks.
      > Unable to load Maven meta-data from http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-tasks/maven-metadata.xml.
         > Could not get resource 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-tasks/maven-metadata.xml'.
            > Could not GET 'http://repo.iotize.com/artifactory/gradle-release/com/google/android/gms/play-services-tasks/maven-metadata.xml'. Received status code 401 from server: Unauthorized

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s

Possibly related: https://stackoverflow.com/questions/60107246/could-not-determine-the-dependencies-while-using-com-onesignalonesignal-sdk-and

┆Issue is synchronized with this Asana task by Unito

xcode 11 ios 13 onesignal error log

[Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
[Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
ERROR: Encountered error during email registration with OneSignal: (null)
[Client] Updating selectors after delegate removal failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
ERROR: HTTP Request (OSRequestRegisterUser) must contain app_id parameter
ERROR: Encountered error during push registration with OneSignal: Error Domain=OneSignalError Code=-1 "(null)" UserInfo={error=HTTP Request (OSRequestRegisterUser) must contain app_id parameter}

How I can fix this error ?

Thank you.

┆Issue is synchronized with this Asana task by Unito

fix: use applicationId instead of PACKAGE_NAME

if the cordova app has flavors (like debug and release version with different applicationId value), the PACKAGE_NAME value remains fixed to the value of the id in config.xml, and that causes problems when you try to install a different flavor of the app as there is another app (the other flavor) that already declared a push permission for that package name.
By using the applicationId variable, each flavor will have it's own permission matching the application Id.

This was fixed in other push plugins long ago, check
https://github.com/phonegap/phonegap-plugin-push/blob/master/plugin.xml#L31
https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L140

┆Issue is synchronized with this Asana task by Unito

BUILD FAILED (Android) Error: ADMMessageHandler must extend

Description:
Hi, my Ionic/Cordova app can not be build with the last version of the OneSignal plugin. It works with [email protected] (Android 28) but it does not work with [email protected] targeting Android 29, generating the signed APK throws strange errors related with the Amazon SDK and a corrupted APK.

Environment
Cordova CLI : 10.0.0
OneSignal: 2.11.0
Android Target: 29
Ionic CLI: 6.11.1
Ionic Framework: @ionic/angular 4.7.4

Steps to Reproduce Issue:
1.- Add the onesignal-cordova-plugin to your project
2.- Build the project ($ ionic cordova build --release android)

Console Output:

cordova build android --release
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/ararage/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/ararage/Library/Android/sdk
Reading build config file: /Users/ararage/Documents/Projects/xxxxx/2019-2020/xxxxx/build.json

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 5 stopped Daemons could not be reused, use --status for details

Configure project :app
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.

Task :app:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/ararage/Documents/Projects/xxxxx/2019-2020/xxxxx/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Task :app:lintVitalRelease
/Users/ararage/Documents/Projects/xxxxx/2019-2020/xxxxx/platforms/android/app/src/main/AndroidManifest.xml:13: Error: ADMMessageHandler must extend android.app.Service [Instantiatable]

/Users/ararage/Documents/Projects/xxxxx/2019-2020/xxxxx/platforms/android/app/src/main/AndroidManifest.xml:14: Error: Receiver must extend android.content.BroadcastReceiver [Instantiatable]
<receiver android:name="com.onesignal.ADMMessageHandler$Receiver" android:permission="com.amazon.device.messaging.permission.SEND">

Explanation for issues of type "Instantiatable":
Activities, services, broadcast receivers etc. registered in the manifest
file (or for custom views, in a layout file) must be "instantiatable" by
the system, which means that the class must be public, it must have an
empty public constructor, and if it's an inner class, it must be a static
inner class.

2 errors, 0 warnings

Task :app:stripReleaseDebugSymbols FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:stripReleaseDebugSymbols'.
No version of NDK matched the requested version 21.0.6113669. Versions available locally: 21.3.6528147, 21.3.6528147

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 7s
42 actionable tasks: 42 executed
Command failed with exit code 1: /Users/ararage/Documents/Projects/xxxxx/2019-2020/xxxxx/platforms/android/gradlew cdvBuildRelease -b /Users/ararage/Documents/Projects/xxxxx/2019-2020/xxxxx/platforms/android/build.gradle
[ERROR] An error occurred while running subprocess cordova.

    cordova build android --release exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

┆Issue is synchronized with this Asana task by Unito

Little question

❓ ❓ ❓

Is it correct?

.addPermissionObserver(function(state) {
  console.log("Notification permission state changed: " + state.hasPrompted);
  console.log("Notification permission status: " + state.status);
});

❗ ❗ ❗

I'm only have success with this

this.signal.addPermissionObserver().subscribe(
      value => {

I'm not like unfollow the oficial docs, tnks anyway

I'm using Ionic v4 with capacitor

cannot build app due to compile sdk version

Description:

OneSignalPlugin: WARNING: OneSignalPlugin: Downgraded 'com.android.support:28.+' -> 28 to prevent compile errors! Recommend updating your project's compileSdkVersion!

Environment

Ionic:

Ionic CLI : 6.1.0 (/Users/.nvm/versions/node/v10.16.3/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 4.6.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.3.0

Cordova:

Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 25 other plugins)

Steps to Reproduce Issue:

  1. ionic cordova build android

Anything else:

(crash stacktraces, as well as any other information here)

Task :app:mergeDebugAssets
OneSignalPlugin: WARNING: OneSignalPlugin: Downgraded 'com.android.support:28.+' -> 28 to prevent compile errors! Recommend updating your project's compileSdkVersion!

┆Issue is synchronized with this Asana task by Unito

onesignal cordova app handleNotificationOpened not fired when app is swiped away in ios

Description:
When app is swiped away or killed on ios, and notification arrives it's not navigating users to specific page. but works when app is in foreground.

Environment

  1. "cordova-ios": "5.1.1"
  2. "onesignal-cordova-plugin": "2.11.0"

Steps to Reproduce Issue:

  1. Add the onesignal-cordova-plugin to your project
  2. Initialize the plugin with your app ID
  3. Send notification from Onesignal dashboard with additional data
  4. Add alert message on handleNotificationOpened and check whether alert is displayed when opening app opened from notification

┆Issue is synchronized with this Asana task by Unito

BUILD FAILED - Could not determine the dependencies of task ':app:lintVitalRelease'.

Description:
Hi, my cordova app can not be build with OneSignal plugin. It works with [email protected] (Android target: android-28) but it does not work with [email protected] (Android target: android-29).

This is concerning because Google does not permit to release apps with target 28.

Environment
OneSignal: 2.11.0
Cordova: 9.0.0
Android target: android-29

Steps to Reproduce Issue:

  1. Add the onesignal-cordova-plugin to your project
  2. Build the project

Console output:

Using cordova-fetch for cordova-android@^9.0.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: xx.xxxxxxxxxx.xxxxxxxxxx
        Name: XXXXXX
        Activity: MainActivity
        Android target: android-29
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]
Installing "cordova-plugin-app-version" for android
Installing "cordova-plugin-badge" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-camera" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-file" for android

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

      "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.

Installing "cordova-plugin-geolocation" for android
Installing "cordova-plugin-inappbrowser" for android
Installing "cordova-plugin-ionic-keyboard" for android
Installing "cordova-plugin-ionic-webview" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-local-notification" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-device" already installed on android.
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-badge" already installed on android.
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-nativestorage" for android
Installing "cordova-plugin-screen-orientation" for android
Plugin dependency "[email protected]" already fetched, using that version.
Installing "es6-promise-plugin" for android
Installing "cordova-plugin-splashscreen" for android
Installing "cordova-plugin-transport-security" for android
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "cordova.plugins.diagnostic" for android
Subproject Path: CordovaLib
Subproject Path: app
Dependent plugin "es6-promise-plugin" already installed on android.
Installing "onesignal-cordova-plugin" for android
Subproject Path: CordovaLib
Subproject Path: app
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\AndroidSDK (DEPRECATED)
Using Android SDK: C:\AndroidSDK
> Task :wrapper

BUILD SUCCESSFUL in 3s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
   Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!
OneSignalPlugin: WARNING: OneSignalPlugin: Downgraded 'com.android.support:28.+' -> 28 to prevent compile errors! Recommend updating your project's compileSdkVersion!

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app
   > Could not find com.android.support:support-annotations:28.
     Required by:
         project :app
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app
   > Could not find com.android.support:appcompat-v7:28.
     Required by:
         project :app
   > Could not find com.android.support:cardview-v7:28.
     Required by:
         project :app > com.onesignal:OneSignal:3.15.1
   > Could not find com.android.support:support-fragment:28.
     Required by:
         project :app > com.onesignal:OneSignal:3.15.1
   > Could not find com.android.support:customtabs:28.
     Required by:
         project :app > com.onesignal:OneSignal:3.15.1
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app > com.google.android.gms:play-services-basement:16.0.1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s
Command failed with exit code 1: C:\xxxxxx\xxxxxx\platforms\android\gradlew cdvBuildRelease -b C:\xxxxxx\xxxxxx\android\build.gradle

┆Issue is synchronized with this Asana task by Unito

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.