OneSignal / OneSignal-Android-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native Android or Amazon app with OneSignal. https://onesignal.com
Other
604 stars 368 forks source link

Crash - After IAM click button with "Send to test Device" #1113

Closed restart916 closed 2 years ago

restart916 commented 4 years ago

Description:

Crash app after IAM click button It happens after add setInAppMessageClickHandler and "Send to test Device" from admin page

Environment

compileSdkVersion 28 targetSdkVersion 28 implementation 'com.onesignal:OneSignal:3.15.2'

Steps to Reproduce Issue:

  1. [ADMIN] Create two inapp on admin page.
    • first
    • has button with click action -> add some action name
    • second
    • set 3. Triggers -> When certain conditions are satisfied during the session
      • IN-APP TRIGGER -> any key, any value
  2. [Android] add setInAppMessageClickHandler with onesignal.init
  3. [Android] add any OneSignal.addTriggers(addTriggers); in inAppMessageClicked
  4. [ADMIN] Go first inapp edit page. Click "Send to test Device" on onesignal admin page
  5. [Android] Click button on android virtual device
  6. [Android] Crash app

Anything else:

2020-08-13 15:49:12.603 5962-5962/com.mindclass.android E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mindclass.android, PID: 5962
    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        at com.onesignal.OSInAppMessage.equals(OSInAppMessage.java:238)
        at java.util.ArrayList.indexOf(ArrayList.java:331)
        at java.util.ArrayList.contains(ArrayList.java:314)
        at com.onesignal.OSInAppMessageController.dismissCurrentMessage(OSInAppMessageController.java:582)
        at com.onesignal.OSInAppMessageController.messageWasDismissed(OSInAppMessageController.java:565)
        at com.onesignal.OSInAppMessageController.messageWasDismissed(OSInAppMessageController.java:541)
        at com.onesignal.WebViewManager$6.onMessageWasDismissed(WebViewManager.java:352)
        at com.onesignal.InAppMessageView.cleanupViewsAfterDismiss(InAppMessageView.java:457)
        at com.onesignal.InAppMessageView.access$1900(InAppMessageView.java:45)
        at com.onesignal.InAppMessageView$8.onAnimationEnd(InAppMessageView.java:577)
        at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
        at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1242)
        at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1484)
        at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
        at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
        at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:964)
        at android.view.Choreographer.doCallbacks(Choreographer.java:790)
        at android.view.Choreographer.doFrame(Choreographer.java:721)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
restart916 commented 4 years ago

I created PR https://github.com/OneSignal/OneSignal-Android-SDK/pull/1115

rgomezp commented 4 years ago

Howdy, Thank you for the contribution. We will take a look as soon as we can.

Cheers

Jeasmine commented 4 years ago

Hello @restart916, thanks for the steps, this is something we will take care of. In the meantime take a look at the new Beta major release, we will love to have your feedback.

MrTarantula commented 4 years ago

Will this make it into a minor release? I'm running into this same issue on Android (Flutter SDK).

restart916 commented 4 years ago

@MrTarantula I fork this repo for temporary in android. implementation 'com.github.restart916:OneSignal-Android-SDK:3.15.2.3'

MrTarantula commented 4 years ago

@restart916 Thanks but for Flutter I think I would need it as a gradle plugin. I'm not quite sure, though, as I'm relatively new to native Android development.

ggallotti commented 3 years ago

Same Issue here. OneSignal 3.15.6

nan-li commented 2 years ago

This has been fixed in:

Closing issue