-
Notifications
You must be signed in to change notification settings - Fork 5
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 will crash while on receiving notification #8
Comments
Could you give us your notification payload? It helps us to find out what is the problem. [PushClientManager defaultManager].enableLog = YES; |
@Husseinhj Do you mean this ? |
It's hard to find the exact notification payload. If using the API so give me the notification payload here to see this or using the Chabok panel give me the JSON of data in push message. |
@Husseinhj [{
"user": "apple09176062135",
"content": "test",
"inApp": false,
"live": false,
"useAsAlert": true,
"alertText": "test",
"notification": {
"title": "test",
"body": "test1",
"sound": "string"
}
}
] |
I think your app crashed when reloading the JS. This was only happening on Reload.
|
@Husseinhj no!not only happening on Reload . |
If you give me the scenario it helps me to fix this. #import "React/RCTBridgeModule.h"
#import "React/RCTEventEmitter.h"
@interface AdpPushClient : RCTEventEmitter <RCTBridgeModule,RCTInvalidating>
@end Test with this change. |
@Husseinhj |
Are you calling any SDK methods in your app's background thread @aminvb12 ? |
@behrad No |
This error shows that Chabok methods may have been called from background threads. @aminvb12 Please give some details or a simulation of your code path (sample of how are you calling chabok methods) so that we can re-generate this. And that method is not related to receiving notification. Make sure you are giving us correct details. |
@behrad init_chabok_notification = async()=>{
const options = {
"appId": "*************************",
"apiKey": "/*/*/*/*",
"username": "****",
"password": "&&&&&",
"isDev": true
};
let USER = await AsyncStorage.getItem('user');
if(!USER){
return
}
USER = 'apple'+JSON.parse(USER).username;
// let phone = ;
var channels = ["adv", "news" , USER ];
this.chabok = new chabok.AdpPushClient();
this.chabok.initializeApp('ashawash', options , (response) => {
});
const chabokEmitter = new NativeEventEmitter(NativeModules.AdpPushClient);
chabokEmitter.addListener(
'connectionStatus',
(status) => {
console.log('connectionStatus', status)
}
);
chabokEmitter.addListener(
'ChabokMessageReceived',
(message) => {
console.log("\nChabok Message Received :", message);
}
);
this.chabok.register(USER, channels);
this.chabok.addTag(USER)
// // subscribe to channel
// this.chabok.subscribe(channels[0]).then(res => () => {
// console.log(res);
// alert('subscribe success');
// });
} |
We will go through your code and test it @aminvb12 However I see some strange points in your code:
|
@aminvb12 Did you update the Chabok to the last version (v1.0.0)? |
@aminvb12 آیا مشکل شما حل شده است؟ |
Hi first of all thanks for your support.
My react-native app will crash & also freeze, sometimes while receiving notification but there is no error on xcode or react-native console ,just show :
#11 0x000000010277162c in -[RCTEventEmitter sendEventWithName:body:] at /projectPath/projectName/node_modules/react-native/React/Modules/RCTEventEmitter.m:39
and :
Thread 1: signal SIGABRT.
I will be thankful from your team if you answer my issue.
The text was updated successfully, but these errors were encountered: