简体   繁体   中英

Permission Alert in iOS when making networking request

When making a networking request using the ACAccount and SLRequest objects in iOS, an alert appears when the app runs that asks

X app would like access to Twitter accounts

with buttons for "Don't Allow" and "OK.

Where does this alert get called from? What method/object is it associated with? Where can I modify this alert and can I modify it so the user can pick from accounts?

It's this method [ACAccountStore – requestAccessToAccountsWithType:options:completion:] that shows this alert. that's why there's a completion block, it is only called after the user taps one of the buttons, or on some errors.

The completion block gives you a pointer to an array of accounts if the user gives you permission, so maybe you could present another alert for him to choose from these accounts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM