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

App crash with ToastAndroid #40

Open
CodeoLTD opened this issue Feb 3, 2016 · 3 comments · May be fixed by #45
Open

App crash with ToastAndroid #40

CodeoLTD opened this issue Feb 3, 2016 · 3 comments · May be fixed by #45

Comments

@CodeoLTD
Copy link

CodeoLTD commented Feb 3, 2016

when I Import the ToastAndroid component of react-native, anywhere in my app, and send a notification when the app is closed, the app crash.
In ToastAndroid.android.js the line: var RCTToastAndroid = require('NativeModules').ToastAndroid;
returns a null value.
I'm not sure if this is an issue to you or react-native main git but thought you should know.

@dustinosity
Copy link

I get the same behavior when I do an
import codePush from 'react-native-code-push';

@dustinosity
Copy link

When the app is killed/closed and a notification is received BackgroundService.java (from react-native-gcm-android) is loaded in place of your normal MainActivity.java, but still loads your normal index.android.bundle. I think this is where the compatibility problem is. Maybe if BackgroundService.java could load an alternate bundle file that doesn't contain the conflicting imports? Or the BackgroundService.java could be made more compatible with other native packages?

@dustinosity
Copy link

I would prefer the latter solution since I'm sending data payloads in my gcm's and would like to load enough of my app to at least get access to my redux data stores to save the data. (though I suppose that could also be accomplished with a parred down version of my index.android. js...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant