Flutter: Activity recognition/Motion and fitness permission popup not shown in iOS platform

704

The workaround I found was to use Permission.sensors instead of Permission.activityRecognition for iOS platform. The code goes like this:-

Permission getMotionPermission() {
    if(Platform.isAndroid /** Also check if SDK >= 29 **/){
         return Permission.activityRecognition;   
    } else if(Platform.isIOS) {
         return Permission.sensors;
    }
}

// ask for permission
Permission motionPermission = getMotionPermission();
motionPermission?.request();
Share:
704
bikram
Author by

bikram

~ stay unsatisfied

Updated on December 29, 2022

Comments

  • bikram
    bikram over 1 year

    In Flutter, I am not able to ask the user for motion and fitness permission in iOS platform. I am using this library for permission handling and I am using following code

    Permission.activityRecognition.request()
    
    // Android
    // Asks for permission
    
    // iOS
    // No prompt