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

Onesignal received and opened events stops once application is minimized #597

Closed
gitsuraj opened this issue Aug 6, 2018 · 3 comments
Closed

Comments

@gitsuraj
Copy link

gitsuraj commented Aug 6, 2018

Description:

Onesignal received and opened events are not consistent. I am getting trouble tracking received event in onesignal as it's not getting fired sometime. When I re-run app from android studio it will work again. Any suggestions ?
(your description here)

  1. Install the OneSignal SDK using npm into your project
  2. Initialize the SDK in js
  3. Attempt to receive a push notification
  4. onReceived and onOpened callbacks won't get called sometimes

Environment

  1. What version of the OneSignal React-Native SDK are you using?
    3.2.5
  2. How did you add the SDK to your project (eg. npm)
    0.55.2
  3. MacOs

Steps to Reproduce Issue:

class MainRoot extends React.Component{
constructor(props){
super(props);
this.onIds = this.onIds.bind(this);
this.onReceived = this.onReceived.bind(this);
this.onOpened = this.onOpened.bind(this);
}

componentWillMount() {
OneSignal.init("XXXXXXXXX");
OneSignal.inFocusDisplaying(2);
OneSignal.addEventListener('ids', this.onIds);
OneSignal.configure();
OneSignal.addEventListener('received', this.onReceived);
OneSignal.addEventListener('opened', this.onOpened);
}

onIds(idData){
console.log(idData,"ids data");
}

onReceived(request) {
console.log("received",request)
}

onOpened(openResult) {
console.log('Data: Navigate to this', openResult);
}

componentWillUnmount() {
OneSignal.removeEventListener('opened', this.onOpened);
OneSignal.removeEventListener('received', this.onReceived);
}

render(){
return(

{Routes}

);
}
}

Anything else:

(crash stacktraces, as well as any other information here)

@gitsuraj
Copy link
Author

gitsuraj commented Aug 6, 2018

Just added OneSignal.setLogLevel(0, 6) and there was error

Both GCM & FCM Libraries detected! Please remove the deprecated GCL library.

I am using detached expo application

@gitsuraj
Copy link
Author

gitsuraj commented Aug 7, 2018

Tried in genymotion
First run works fine.
Minimize application
Log --- >>

  • Debug : registerUser:registerForPushFired:true,locationFired:true,awlFired:true
  • Info : Device registered, push token = XXXXXXX
  • Info : ScheduleSyncServiceAsJob: result: 1
  • Vebose : scheduleSyncServiceAsJob:atTime:299981
  • Verbose: scheduleLocationUpdateTask:delayMs:299981
  • Verbose: scheduleLocationUpdateTask:delyaMs;299999
  • Debug: scheduleSyncServiceAsJob:result:1
  • Verbose : scheduleSyncServiceAsJob:atTime:299995
  • Debug LollipopSyncRunnable:JobFinished
  • Info: getUnsentActiveTIme: 0
  • Debug : registerUser:registerForPushFired:true,locationFired:true,awlFired:true
  • Debug: curActivity is NOW: host.exp.exponent.MainActivity:host.exp.exponent.MainActivity@8bbef59

App doesn't fires received and opened events any further now.

@gitsuraj gitsuraj changed the title Onesignal received and opened events are not consistent Onesignal received and opened events stops once application is minimized Aug 7, 2018
@Nightsd01
Copy link
Contributor

Nightsd01 commented Aug 7, 2018

Thanks for reporting this, I'll be closing this issue because it's a duplicate of #583. We have fixed this problem and we are planning to include the fix in a new release in the next few hours.

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

No branches or pull requests

2 participants