File tree Expand file tree Collapse file tree 1 file changed +9
-19
lines changed
TestProjects/Main/Assets/Scripts Expand file tree Collapse file tree 1 file changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -290,26 +290,16 @@ private void InstantiateAllTestButtons()
290
290
291
291
void RequestNotificationPermission ( )
292
292
{
293
- var permission = AndroidNotificationCenter . UserPermissionToPost ;
294
- if ( permission == PermissionStatus . Allowed )
295
- m_LOGGER . Green ( "Already authorized" ) ;
296
- if ( permission == PermissionStatus . DeniedDontAskAgain )
297
- m_LOGGER . Red ( "Denied, don't ask again" ) ;
298
- else
293
+ var request = new PermissionRequest ( ) ;
294
+ switch ( request . Status )
299
295
{
300
- m_LOGGER . Blue ( "Requesting permission" ) ;
301
- permission = AndroidNotificationCenter . RequestPermissionToPost ( ) ;
302
- switch ( permission )
303
- {
304
- case PermissionStatus . Allowed :
305
- m_LOGGER . Green ( "Permission granted" ) ;
306
- break ;
307
- case PermissionStatus . RequestPending :
308
- return ;
309
- default :
310
- m_LOGGER . Red ( permission . ToString ( ) ) ;
311
- break ;
312
- }
296
+ case PermissionStatus . Allowed :
297
+ m_LOGGER . Green ( "Already allowed" ) ;
298
+ break ;
299
+ case PermissionStatus . Denied :
300
+ case PermissionStatus . DeniedDontAskAgain :
301
+ m_LOGGER . Red ( request . Status . ToString ( ) ) ;
302
+ break ;
313
303
}
314
304
}
315
305
You can’t perform that action at this time.
0 commit comments