@@ -698,16 +698,12 @@ - (void)testPromptForPushNotificationsWithUserResponseOnIOS9 {
698698 XCTAssertTrue (didAccept);
699699}
700700
701+ // We should always register right away regardless of notification prompt status
701702- (void )testPromptedButNeveranswerNotificationPrompt {
702703 [UnitTestCommonMethods setCurrentNotificationPermissionAsUnanswered ];
703704 [OneSignal promptForPushNotificationsWithUserResponse: nil ];
704705 [UnitTestCommonMethods initOneSignal_andThreadWait ];
705706
706- // Don't make a network call right away
707- XCTAssertNil (OneSignalClientOverrider.lastHTTPRequest );
708-
709- // Triggers the 30 fallback to register device right away.
710- [OneSignal performSelector: NSSelectorFromString (@" registerUser" )];
711707 [UnitTestCommonMethods runBackgroundThreads ];
712708
713709 XCTAssertEqualObjects (OneSignalClientOverrider.lastHTTPRequest [@" app_id" ], @" b2f7f966-d8cc-11e4-bed1-df8f05be55ba" );
@@ -1498,26 +1494,25 @@ - (void)testGetTagsWithNestedDelete {
14981494}
14991495
15001496- (void )testSendTagsBeforeRegisterComplete {
1501- [UnitTestCommonMethods setCurrentNotificationPermissionAsUnanswered ];
1502- [UnitTestCommonMethods initOneSignal ];
1497+ [OneSignal sendTag: @" key" value: @" value" ];
15031498 [UnitTestCommonMethods foregroundApp ];
15041499 [UnitTestCommonMethods runBackgroundThreads ];
15051500
15061501 NSObjectOverrider.selectorNamesForInstantOnlyForFirstRun = [@[@" sendTagsToServer" ] mutableCopy ];
15071502
1508- [OneSignal sendTag: @" key " value: @" value " ];
1503+
15091504 [UnitTestCommonMethods runBackgroundThreads ];
15101505
15111506 // Do not try to send tag update yet as there isn't a player_id yet.
1512- XCTAssertEqual (OneSignalClientOverrider.networkRequestCount , 1 );
1507+ XCTAssertEqual (OneSignalClientOverrider.networkRequestCount , 0 );
15131508
1514- [UnitTestCommonMethods answerNotificationPrompt: false ];
1509+ [UnitTestCommonMethods initOneSignal ];
15151510 [UnitTestCommonMethods runBackgroundThreads ];
15161511
15171512 // A single POST player create call should be made with tags included.
15181513 XCTAssertEqual (OneSignalClientOverrider.networkRequestCount , 2 );
15191514 XCTAssertEqualObjects (OneSignalClientOverrider.lastHTTPRequest [@" tags" ][@" key" ], @" value" );
1520- XCTAssertEqualObjects (OneSignalClientOverrider.lastHTTPRequest [@" notification_types" ], @0 );
1515+ XCTAssertEqualObjects (OneSignalClientOverrider.lastHTTPRequest [@" notification_types" ], @15 );
15211516 XCTAssertEqualObjects (OneSignalClientOverrider.lastHTTPRequest [@" identifier" ], @" 0000000000000000000000000000000000000000000000000000000000000000" );
15221517}
15231518
0 commit comments