-
Notifications
You must be signed in to change notification settings - Fork 76
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 crashes when App is killed completely.. #26
Comments
What version of React Native and react-native-gcm-android are you using? |
"react-native-gcm-android": "0.1.6", "react-native": "^0.17.0", are the On 18 January 2016 at 14:10, Howard Yang [email protected] wrote:
JOJO |
Can you run |
Hi oney, this is my log.
|
Oh, I guess it is related to this.
|
It still results in the same issue :( |
Do you load js bundle from 10.0.3.2:8081? |
I do. On 18 January 2016 at 18:05, Howard Yang [email protected] wrote:
JOJO |
:( On 18 January 2016 at 18:13, Joselito Narte [email protected] wrote:
JOJO |
Maybe it's related to facebook/react-native#3167 (comment) |
I just did this and it still didn't work out :'( On 18 January 2016 at 18:27, Howard Yang [email protected] wrote:
JOJO |
Can you show |
/**
var React = require('react-native'); var { var cssVar = require('cssVar');
device used your credentials");
}
function(notification) {
console.log('POSSSSIITIOOON'+JSON.stringify(this.state.position));
"Installer App"};
Navigator.SceneConfigs.FloatFromRight}
require('./config/constants/images').HAMBURGER, show: 'always'}]}/>
require('./components/WorkerJobListView.js');
require('./components/WorkOrderDetailsList.js');
require('./components/SignatureView.js');
location:self.state.position.coords.lat+','+self.state.position.coords.lng, var NavigationBarRouteMapper = {
source={require('./config/constants/images').BACK_NAV_BUTTON}/>
source={require('./config/constants/images').HAMBURGER}/>
};
}); AppRegistry.registerComponent('app_mobile', () => app_mobile); On 18 January 2016 at 19:36, Howard Yang [email protected] wrote:
JOJO |
Hmmm... It seems it's not related. |
Yup I already did that yesterday. :'( On 18 January 2016 at 20:02, Howard Yang [email protected] wrote:
JOJO |
Can you try again and get the logs? |
Any idea how to fix this? com.android.ide.common.process.ProcessException: On 18 January 2016 at 20:19, Howard Yang [email protected] wrote:
JOJO |
Please try cleaning the project cd android
./gradlew clean |
The error still persists :( On 18 January 2016 at 22:21, Howard Yang [email protected] wrote:
JOJO |
Have you tested the demo project? https://github.com/oney/TestGcm |
The demo project doesn't crash as you are using a custom java wrapper which On 19 January 2016 at 15:30, Howard Yang [email protected] wrote:
JOJO |
In demo project, when the app is killed, we still handle notification in JS code. if (GcmAndroid.launchNotification) {
console.log('GcmAndroid.launchNotification:', GcmAndroid.launchNotification);
var notification = GcmAndroid.launchNotification;
var info = JSON.parse(notification.info);
Notification.create({
subject: info.subject,
message: info.message,
});
GcmAndroid.stopService();
} When it receives GCM notification and the app is killed, it will launch a service that creates a new React Native instance in the background. |
Should I use System notification module as you did there? On 19 January 2016 at 15:47, Howard Yang [email protected] wrote:
JOJO |
Yes, you should. |
I'm also getting a crash if the app is closed.
However I'm getting another weird behaviour: I have installed the TestGcm app and my app with different tokens and Authorizations keys. However if both apps are closed and I send a notification to my app (my token and my authorization key) the crash occurs but when I click the notification your app is the one that opens. Actually, I didn't have the console log of GcmAndroid.launchNotification so it's the TestGcm app that receives the |
Can you use |
I usally get logs with:
When I open the app:
When I receive a notification with all apps closed:
NOTE: That console log is from TestGcm but the token sent was for my App. Now I tried to generate a signed APK but I got this error.
The react-native run-android goes OK but generating the APK gives this error. |
Please use |
Sorry for the long comment: I did
|
OK, new test. I uninstalled the TestGCM app and now my app doesn't catch the I would like to test with the signed APK to exclude problems with connections to the packager, but as mentioned before I can't generate it with this module installed. |
Edit: |
I'm on RN 0.17. index.android.js:
|
Please try change to the following codes in <receiver
android:exported="false"
android:name="com.oney.gcm.GcmBroadcastReceiver">
<intent-filter>
<action android:name="com.oney.gcm.GCMReceiveNotification" />
</intent-filter>
</receiver> |
No success. :( Exactly the same error.
|
I have tried recreating a new RN project and failed to reproduce your issue. But, there is really a issue that you mentioned.
The solution is adding <receiver
android:exported="false"
android:name="com.oney.gcm.GcmBroadcastReceiver">
<intent-filter>
<action android:name="com.oney.gcm.GCMReceiveNotification" />
</intent-filter>
</receiver> I also publish new version 0.2.0. In this version, I print many logs to make debugging more easily. Please try new version module. Make sure to re-read README and delete TestGcm. Then, give me some logs when the crash happens. |
I uninstalled your module and reinstalled but there was an warning:
I then installed manually system-notification:
Anyway, with this new version I keep getting the
and
But with tha app closed, I keep getting:
I also can't still generate a signed APK:
I don't know, maybe another module is conflicting:
|
This issue is tricky. Unfortunately, I met it also and have no idea how to fix it. |
for my case any idea to fix? |
@oney |
I just wrote about a possible workaround for this issue here: #51 (comment) |
Comment the line. It should work. My index.android.js snippet: ` //GcmAndroid.stopService(); |
I am getting the same: I tried @savioseb suggestion but it didn't work out.
Is this relevant "Failed to resolve target intent service, skipping classname enforcement" ? |
this is a tricky issue, what I did was to create my own GCMListener service. |
@jojonarte yes, but I don't understand why it works for other people? We all seem to have an error on ToastAndroid? |
@edo1493 I'm not sure but I think the issue is because you aren't sending the message correctly... The JSON should have a "subject" and "message", at least that's what in my Intent My JSON that I curl on GCM Server:
|
I've been working on this app for a while using your module, it seems fine for when the app is in the background but crashes when app is completely killed from the device. Is there any workaround for this issue?? Please let me know :(
The text was updated successfully, but these errors were encountered: