Sub Activity_Resume
Wait For (CheckPermissions) Complete (Success As Boolean)
If Success = False Then
Msgbox2Async("You need to grant some permissions in order to install the app", "INSTALLATION ABORTED", "OK", "", "", Null, False)
Wait For Msgbox_Result (Result As Int)
ExitApplication
End If
End Sub
Sub CheckPermissions As ResumableSub
For Each per In Array(rp.PERMISSION_ACCESS_COARSE_LOCATION ,rp.PERMISSION_ACCESS_FINE_LOCATION, rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
rp.CheckAndRequest(per)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result = False Then Return False
Next
Return True
End Sub