Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Runtime Permission Tips on Flutter

Runtime Permission Tips on Flutter

This is a slide on potatotips 75.
「Runtime Permission Tips on Flutter」
#potatotips #flutterjp #flutter

97a7f7899e0df28c3636b8d44bbe6578?s=128

Kenichi Kambara

August 12, 2021
Tweet

Transcript

  1. 2021.08.12 Kenichi Kambara (@korodroid) potatotips #75 Runtime Permission Tips on

    Flutter
  2. About me •Mobile App Development •Speeches (e.g. 9 International confs.)

    •Writings (e.g. 5 Dev Books) •[Of fi cial] Evangelist at NTT TechnoCross •[Private] iplatform.org Kenichi Kambara (@korodroid)
  3. My Activity (Sekaiphone: Speech Translation) Android: Kotlin, iOS: Swift Android/iOS:Flutter

  4. Motivation (Runtime Permission on Flutter) 

  5. Before developing a wheel https://pub.dev/ 

  6. My choice: permission_handler 2 1 How to add How to

    import 
  7. Here are some required steps for each OS Adding Permissions

    on AndroidManifest.xml etc. Adding Permissions on Info.plist & Pod fi le etc. Setup ref: https://pub.dev/packages/permission_handler 
  8. 1. Requesting Runtime Permission // e.g. Requesting microphone Permission var

    status = await Permission.microphone.request(); Result (example) - Granted - Denied - PermanentlyDenied - Restricted 
  9. 2. Con fi rming Runtime Permission status // e.g. Return

    value of checking await Permission.microphone.status.isGranted; await Permission.microphone.status.isDenied; await Permission.microphone.status.isPermanentlyDenied; await Permission.microphone.status.isRestricted; 
  10. 3. Recovering from PermanentlyDenied // for PermanentlyDenie d if (statuses[Permission.microphone].isPermanentlyDenied)

    { // show System Dialog
 openAppSettings(); } 
  11. 4. [Android] Supporting “Rationale” // for explaining why this app

    requires this permissio n if (await Permission.speech.shouldShowRequestRationale) { // show App’s Dialog } 
  12. Please let me know if you have any requests 


    such as technical speeches, technical writings and so on. Facebook:http://fb.com/kanbara.kenichi Twitter:@korodroid LinkedIn:http://www.linkedin.com/in/korodroid Thank you so much