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
missing runtime permission request; causes crashes on Android 6 #3
Comments
Hi, @eksperts. You are free to make PR for runtime permission. I'm pretty busy now and fuse is not in my priority list. I also have no Android device at hand to fully test. |
Sadly, my hands are full at the moment too. I'll ping here if I get to it. |
@MaxGraey you're up ^ |
Can you implement sync UUID property using public static extern(Android) string UUID()
if (_authorizePromise == null) {
_authorizePromise = new Promise<string>();
Permissions.Request(Permissions.Android.READ_PHONE_STATE).Then(AuthorizeResolved, AuthorizeRejected);
_authorizePromise.Wait();
}
return _authorizePromise.Result;
} |
@MaxGraey nope, my Uno knowledge ends at what I've done |
Also, I would like to advocate this approach. |
Ok, Just copy code above and test on your device if it fail, don't do father investigations |
How's that argument above @MaxGraey ? Or you want the request to fire as soon as an app launches? |
Yes, just above part. I prefer init all lazily, with less launch-time code if possible |
Not sure I got what you're saying. Is the async approach OK with you, or do you still insist on getting the static UUID working? |
Ok, I explain. if there are has possibility leave old sync approach with new permission implementation it would be nice, because we will keep compatibility with the previous interface |
@MaxGraey ok, the motivation to not introduce breaking changes is clear. However, the current implementation crashes on Android 6, so this breaking change might still be very welcome for Android target. With that in mind, I gave it a go and reimplemented the static I have to point out that I have literally no idea how you could return a dynamic future string in a static context. That |
This line here: https://github.com/MaxGraey/fuse-device/blob/master/Device.uno#L124
You can not ask for
getDeviceId()
until you've requested run-time permissions forREAD_PHONE_STATE
. The install-time permissions added above theGetUUID()
function are not enough.To solve this, I'd suggest taking a similar approach to what is seen here: https://github.com/bolav/fuse-contacts/blob/master/ContactsImpl.Android.uno#L147
The text was updated successfully, but these errors were encountered: