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

iOS: deviceProperties method crashes when device is locked & data protection is set to "complete" #108

Open
3 tasks done
mtamburro opened this issue Oct 10, 2019 · 4 comments · May be fixed by #179
Open
3 tasks done

Comments

@mtamburro
Copy link

mtamburro commented Oct 10, 2019

Bug Report

There is no null checking when creating the dictionary in the deviceProperties method.

Problem

On the Apple developer portal, if you set "data protection" to "complete" for your App ID, and then call this method while your device is locked (e.g., in response to a push notification) some of the properties will be null and result in a crash.

What is expected to happen?

Null properties should not be inserted in to the dictionary, and the App should not crash.

What does actually happen?

The App crashes in the background every time.

Information

An easy way to reproduce this is to turn off your device, then turn it on, but do not enter your passcode to unlock the device. With your device in this state, send a push notification to your app that calls the deviceProperties method.

Command or Code

Environment, Platform, Device

This was first noticed on iOS 13

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@epetre
Copy link

epetre commented Jan 8, 2021

We get increased crashes in iOS and it seems to be pointing to what was described in this issue.

We are unsure how it happens, but here is what it points to:

Fatal Exception: NSInvalidArgumentException
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[4]
-[CDVDevice deviceProperties]

CDVDevice.m - Line 75

@nischalbharat
Copy link

nischalbharat commented Mar 23, 2021

@epetre Do you find any fix for this crash?
I am facing similar situation

We get increased crashes in iOS and it seems to be pointing to what was described in this issue.

We are unsure how it happens, but here is what it points to:

Fatal Exception: NSInvalidArgumentException
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[4]
-[CDVDevice deviceProperties]

CDVDevice.m - Line 75

@epetre
Copy link

epetre commented Aug 5, 2021

No, sadly we did not.

@nvahalik
Copy link

We are having this issue, too. No additional information, unfortunately nor any other reproduction.

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.

4 participants