Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

coldstart is always false on ios #2368

Open
EugeneSnihovsky opened this issue May 15, 2018 · 7 comments
Open

coldstart is always false on ios #2368

EugeneSnihovsky opened this issue May 15, 2018 · 7 comments

Comments

@EugeneSnihovsky
Copy link

EugeneSnihovsky commented May 15, 2018

Steps to Reproduce

I use real device IPad with ios 10.3.3

  1. Simple example
this._pushInstance = PushNotification.init({ ios: { voip: true } });
this._pushInstance.on('notification', (n) => {
    console.log(JSON.stringify(n));
});
  1. Launch app and send voip notification (I use release mode with ssl://gateway.push.apple.com:2195 url). Receive notification with additionalData.coldstart === false

  2. Quit from app (not move to background, full exit). Send voip notification. Receive notification with additionalData.coldstart === false (see it from Xcode device console. Device is connected via cable).

  3. Open app from received push notification. Send another voip notification. Receive notification with additionalData.coldstart === false

Cordova CLI version and cordova platform version

cli packages: (/Users/eugene/.npm-global/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.1.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2 
Node              : v9.6.1
npm               : 5.8.0 
OS                : macOS High Sierra
Xcode             : Xcode 9.3 Build version 9E145 

Plugin version

2.2.2

Logs taken while reproducing problem

I always receive in device log (foreground also not work, always false even app is opened)

{"additionalData":{"foreground":false,"coldstart":false},"message":"message1","sound":"default"}

Is this a bug or I missed something? I need to find programmatically my app state (opened (background/foreground) or fully closed)

@macdonst
Copy link
Member

@jlorente do you have any time to look at this one?

@EugeneSnihovsky
Copy link
Author

As workaround for now I use this check

document.hasFocus()

If application is opened or in background it will be true, if fully closed - false.

@jlorente
Copy link
Contributor

I have a lot of work this week, but i will try to take a look at it on next friday.

@nicolo-paganin
Copy link

anyone has resolved this bug?

@amatakasap
Copy link

I can not tell whether I started the application by tapping push notification while locking on iOS 12.

The status is as follows, this is the same as when you started by tapping the icon.

document.hasFocus() = false
coldstart = false
foreground = false

@jlorente
Copy link
Contributor

I have fixed the foreground attribute in this pull request and will check how to fix coldstart one in the future.

@leonardoMoliveira
Copy link

Same problem here, coldstart is always false on iOS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

6 participants