NathanaelA / nativescript-permissions

Wraps up the entire Android 6 permissions system in a easy to use plugin.
MIT License
46 stars 22 forks source link

iOS Returns True for Compatibility #10

Closed roblav96 closed 8 years ago

roblav96 commented 8 years ago

I was thinking, for cross-platform compatibility, instead of

if (!global.android) {
    return;
}

maybe just return true for iOS?

function hasPermission(perm) {
    if (!hasSupportVersion4()) return true;
    if (!global.android) return true;

    var hasPermission = android.content.pm.PackageManager.PERMISSION_GRANTED ==
        android.support.v4.content.ContextCompat.checkSelfPermission(application.android.foregroundActivity, perm);
    return (hasPermission);
}

Thoughts?

I just saw this issue, https://github.com/NathanaelA/nativescript-permissions/issues/7

NathanaelA commented 8 years ago

I just published a new version (v1.2.0) that has a ios compatibility shim which will return "true" to any and all permissions asked... ;-)

roblav96 commented 8 years ago

Perfect!!! much <3 :D