@@ -105,7 +105,7 @@ describe('messaging()', function () {
105
105
} ) ;
106
106
107
107
it ( 'successfully unregisters on ios' , async function ( ) {
108
- if ( device . getPlatform ( ) === 'ios' ) {
108
+ if ( device . getPlatform ( ) === 'ios' && ! isCI ) {
109
109
await firebase . messaging ( ) . unregisterDeviceForRemoteMessages ( ) ;
110
110
should . equal ( firebase . messaging ( ) . isDeviceRegisteredForRemoteMessages , false ) ;
111
111
tryToRegister = await isAPNSCapableSimulator ( ) ;
@@ -133,8 +133,12 @@ describe('messaging()', function () {
133
133
// our default resolve on android is "authorized"
134
134
should . equal ( await firebase . messaging ( ) . requestPermission ( { provisional : true } ) , 1 ) ;
135
135
} else {
136
- // our default request on iOS results in "provisional"
137
- should . equal ( await firebase . messaging ( ) . requestPermission ( { provisional : true } ) , 2 ) ;
136
+ // our default request on iOS results in "provisional" == 2
137
+ // but we may have granted perms by any outside method == 1
138
+ should . equal (
139
+ ( await firebase . messaging ( ) . requestPermission ( { provisional : true } ) ) >= 1 ,
140
+ true ,
141
+ ) ;
138
142
}
139
143
} ) ;
140
144
} ) ;
@@ -152,7 +156,11 @@ describe('messaging()', function () {
152
156
// Make sure we are registered for remote notifications, else no token
153
157
aPNSCapableSimulator = await isAPNSCapableSimulator ( ) ;
154
158
simulator = await isSimulator ( ) ;
155
- if ( device . getPlatform ( ) === 'ios' && ( ! simulator || ( simulator && aPNSCapableSimulator ) ) ) {
159
+ if (
160
+ device . getPlatform ( ) === 'ios' &&
161
+ ! isCI &&
162
+ ( ! simulator || ( simulator && aPNSCapableSimulator ) )
163
+ ) {
156
164
await firebase . messaging ( ) . registerDeviceForRemoteMessages ( ) ;
157
165
apnsToken = await firebase . messaging ( ) . getAPNSToken ( ) ;
158
166
@@ -568,7 +576,7 @@ describe('messaging()', function () {
568
576
registerDeviceForRemoteMessages,
569
577
} = messagingModular ;
570
578
571
- if ( device . getPlatform ( ) === 'ios' ) {
579
+ if ( device . getPlatform ( ) === 'ios' && ! isCI ) {
572
580
await unregisterDeviceForRemoteMessages ( getMessaging ( ) ) ;
573
581
should . equal ( isDeviceRegisteredForRemoteMessages ( getMessaging ( ) ) , false ) ;
574
582
aPNSCapableSimulator = await isAPNSCapableSimulator ( ) ;
@@ -601,8 +609,9 @@ describe('messaging()', function () {
601
609
if ( device . getPlatform ( ) === 'android' ) {
602
610
should . equal ( await requestPermission ( getMessaging ( ) ) , 1 ) ;
603
611
} else {
604
- // ... and iOS should always be 2 (provisional)
605
- should . equal ( await requestPermission ( getMessaging ( ) , { provisional : true } ) , 2 ) ;
612
+ // our default request on iOS results in "provisional" == 2
613
+ // but we may have granted perms by any outside method == 1
614
+ should . equal ( ( await requestPermission ( getMessaging ( ) , { provisional : true } ) ) >= 1 , true ) ;
606
615
}
607
616
} ) ;
608
617
} ) ;
@@ -622,7 +631,11 @@ describe('messaging()', function () {
622
631
const { getMessaging, getAPNSToken, registerDeviceForRemoteMessages } = messagingModular ;
623
632
aPNSCapableSimulator = await isAPNSCapableSimulator ( ) ;
624
633
simulator = await isSimulator ( ) ;
625
- if ( device . getPlatform ( ) === 'ios' && ( ! simulator || ( simulator && aPNSCapableSimulator ) ) ) {
634
+ if (
635
+ device . getPlatform ( ) === 'ios' &&
636
+ ! isCI &&
637
+ ( ! simulator || ( simulator && aPNSCapableSimulator ) )
638
+ ) {
626
639
await registerDeviceForRemoteMessages ( getMessaging ( ) ) ;
627
640
apnsToken = await getAPNSToken ( getMessaging ( ) ) ;
628
641
0 commit comments