Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with One Signal in React Native after update to AndroidX #817

Closed
YukihiroYamashita opened this issue Jul 24, 2019 · 7 comments
Closed

Comments

@YukihiroYamashita
Copy link

Description:
I have a project with RN 0.59.8 and One Signal version 3.2.12 that I left for 2 months and its working fine, but now, when I build it closes the app without any messages or logs. Then, after I've followed this tutorial Migrating to AndroidX, it worked, but it not sending any push notifications.

Environment

  1. "react-native": "0.59.8",
  2. "react-native-onesignal": "^3.2.12",

Steps to Reproduce Issue:

  1. Install the OneSignal SDK using npm into your project
  2. Initialize the SDK in the React Native
  3. Attempt to receive a push notification
@jkasten2
Copy link
Member

@YukihiroYamashita Can you check the Android logcat for any errors and share them here?

@jkasten2
Copy link
Member

@YukihiroYamashita I am not sure what the specific AndroidX issue you were seeing was but there was a recent bug fix noted in #800 (comment) that might have fixed your issue.

@YukihiroYamashita
Copy link
Author

@jkasten2 I've updated rn onesignal to latest version, now I can send push notifications, but now I get build crashes while running react-native run-android.

@jkasten2
Copy link
Member

@YukihiroYamashita We will need the full stack trace from the logcat to be able to navigate the cause of the crash. Please attach it here.

If you have a repo you can share reproducing the issue that would be helpful.

@YukihiroYamashita
Copy link
Author

@jkasten2 in logcat, I get this
TypeError: RNOneSignal.initNotificationOpenedHandlerParams is not a function. (In 'RNOneSignal.initNotificationOpenedHandlerParams()', 'RNOneSignal.initNotificationOpenedHandlerParams' is undefined)
addEventListener@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:93339:58
componentDidMount$@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:1940:63
tryCatch@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:41716:23
invoke@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:41891:32
tryCatch@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:41716:23
invoke@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:41792:30
http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:41802:21
tryCallOne@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:45432:16
http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:45533:27
_callTimer@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:46300:17
_callImmediatesPass@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:46336:19
callImmediates@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:46555:33
callImmediates@[native code]
__callImmediates@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:16632:35
http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:16453:34
__guard@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:16615:15
flushedQueue@http://192.168.0.10:8081/index.bundle?platform=android&dev=true&minify=false:16452:21
flushedQueue@[native code]
invokeCallbackAndReturnFlushedQueue@[native code]

@jkasten2
Copy link
Member

@YukihiroYamashita It looks like your project can't find the Java part of the OneSignal SDK.

I recommend calling the following to relink the SDK.

react-native unlink react-native-onesignal
react-native link react-native-onesignal

@rgomezp
Copy link
Contributor

rgomezp commented Aug 20, 2019

Closing due to no response

@rgomezp rgomezp closed this as completed Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants