braze-inc / braze-cordova-sdk

Public repo for the Braze Cordova SDK
https://www.braze.com
Other
21 stars 63 forks source link

How to activate Push notifications on iOS? #57

Closed vandres closed 3 years ago

vandres commented 4 years ago

I followed the documentation and can see my connected devices in the Dashboard. But what doesn't happen, is the request for Push on the device, so I can't send push notifications on iOS.

grafik

The Android setup worked. The push certificate is configured and not expired.

My config:

        <preference name="com.appboy.api_key" value="$BRAZE_IOS_API_KEY"/>
        <preference name="com.appboy.ios_api_endpoint" value="sdk.iad-03.appboy.com" />
        <preference name="com.appboy.ios_disable_automatic_push_registration" value="NO" />
        <preference name="com.appboy.ios_disable_automatic_push_handling" value="NO" />
        <preference name="com.appboy.ios_enable_idfa_automatic_collection" value="NO" />
        <preference name="com.appboy.enable_location_collection" value="NO" />
        <preference name="com.appboy.geofences_enabled" value="NO" />
        <preference name="com.appboy.display_foreground_push_notifications" value="YES" />

After the device is ready, I call AppboyPlugin.setPushNotificationSubscriptionType(NotificationSubscriptionType.SUBSCRIBED);

Versions:

Cordova v10 Cordova iOS v6.1.1 Plugin v2.18.0 Device iOS 13.7 XCode 12.1

Bucimis commented 4 years ago

Hi @vandres do you see the SDK requesting a push token, receiving one, and passing it to Braze (there should be a push token visible on the User Profile page for your user)? Or is no push token received at all? Also, does your generated XCode project have the Push capability enabled?

vandres commented 4 years ago

Hi @vandres do you see the SDK requesting a push token, receiving one, and passing it to Braze (there should be a push token visible on the User Profile page for your user)? Or is no push token received at all?

No Token is received. The App is not even requesting the notification access (this little dialog)

Also, does your generated XCode project have the Push capability enabled?

Yes

In-App messaging is worling btw., but that just as a comment

vandres commented 4 years ago

Do I need to register a user first, to receive a token?

Bucimis commented 4 years ago

@vandres yep, when configured correctly, braze should 1) request a push token (provisionally in the case of iOS 12+) via requestAuthorizationWithOptions 2) receive the result in the application delegate didRegisterForRemoteNotificationsWithDeviceToken method 3) pass the token to Braze in the same method, see https://github.com/Appboy/appboy-cordova-sdk/blob/7a988b6382d6cfc7b833abec6da8e7436a66c478/src/ios/AppDelegate%2BAppboy.m#L77

Note that Braze swizzles application delegate methods related to push - if you have another plugin swizzling didRegisterForRemoteNotificationsWithDeviceToken the implementations could be interfering with each other

vandres commented 4 years ago

Can you maybe send me the JS-Code, you would use to enable push on iOS in a Cordova app. I used the code from the Sample-App, but with no success. Maybe the order is important....

I will look through our code, if any other plugin is using the didRegisterForRemoteNotificationsWithDeviceToken. We are using AppsFlyer and InstaBug which might do similar things.

vandres commented 4 years ago

I uninstalled both, with no success

Bucimis commented 4 years ago

@vandres thanks for investigating further. There's actually no javascript code involved in the push setup for iOS. Are you able to take a look at verbose logs (set via Info.plist https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/initial_sdk_setup/other_sdk_customizations/#braze-log-level)? Those should give additional hints into what's going on. Also, since you should have a local copy of the plugin code that does the registration available, I would also recommend setting breakpoints into various parts of the push flow to see it in action and make sure it's working as expected

vandres commented 4 years ago

@Bucimis Thanks, I will check the Logs tomorrow.

vandres commented 4 years ago

Supid question though. Why is there a "com.appboy.android_log_level" preference but not the same for ios?

tbelote commented 4 years ago

@vandres it's not quite the same since it's in the plist not a variable but you can turn on some debug logging for iOS https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/initial_sdk_setup/other_sdk_customizations/

vandres commented 4 years ago

This is the response from the verbose log. He mentions Push, but on my device, I still get no allow notification dialog:

2020-10-23 10:45:03.100283+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKPersistentData setLogLevelFromPlist] Braze log level set to:0
2020-10-23 10:45:03.104553+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager initWithApiKey:requestProcessingPolicy:persistentData:locationManagerDelegate:networkFlushInterval:sdkFlavor:deviceWhitelist:] Initialized shared ABKManager instance with request processing policy: ABKAutomaticRequestProcessing and api key 3fd10363-6cc2-40a5-b8d6-2278f8a34eac
2020-10-23 10:45:03.106460+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKSessionManager startAnalyticsSessionForCurrentUserIfAppropriate] No session currently exists in memory, opening a new session.
2020-10-23 10:45:03.106528+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKSessionManager startAnalyticsSession] Opening a new session and logging a session start event.
2020-10-23 10:45:03.107402+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager requestContentCardsSync] Content cards not enabled. Not requesting content cards.
2020-10-23 10:45:03.107455+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:03.107557+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKReachability networkStatusForFlags:] Reachability Flag Status: -R ------- networkStatusForFlags
2020-10-23 10:45:03.115102+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKPersistentData deviceCarrierForAppSession]_block_invoke Storing new device carrier for app session: Vodafone.de
2020-10-23 10:45:03.116282+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Storing new push auth status: not_determined. Previous status: (null)
2020-10-23 10:45:03.119624+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKService buildURLRequest:] Trigger sync requests in flight: 1
2020-10-23 10:45:03.119776+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request HTTP method POST to https://sdk.iad-03.appboy.com/api/v3/data
2020-10-23 10:45:03.119929+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-TriggersRequest: true
2020-10-23 10:45:03.120035+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header Content-Type: application/json
2020-10-23 10:45:03.120141+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-DataRequest: true
2020-10-23 10:45:03.120271+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-FeedRequest: true
2020-10-23 10:45:03.126718+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-Api-Key: xxx
2020-10-23 10:45:03.126890+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request connection body: {"events":[{"session_id":"04B8597B-33E3-4241-B38D-7638E1391987","data":{},"name":"ss","time":1603439103.1070001}],"app_version":"5.0.0","time":1603439103.119101,"device":{"locale":"de_CH","time_zone":"Europe\/Istanbul","remote_notification_enabled":false,"model":"iPhone8,1","os_version":"13.7","carrier":"Vodafone.de","ios_idfv":"B5D065F8-BCA5-44B1-840F-1C0667B3CA3F","resolution":"750x1334","ios_push_auth":"not_determined"},"device_id":"B5D065F8-BCA5-44B1-840F-1C0667B3CA3F","app_version_code":"5.0.0.0","api_key":"xxx","respond_with":{"triggers":true,"config":{"config_time":0},"feed":true},"sdk_version":"3.27.0","sdk_flavor":"cordova"}
2020-10-23 10:45:03.120297+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.128008+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Storing new push display options.
2020-10-23 10:45:03.128616+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already not_determined. Not updating persistent storage.
2020-10-23 10:45:03.128660+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.128707+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:03.131812+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already not_determined. Not updating persistent storage.
2020-10-23 10:45:03.131868+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.131917+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:03.131958+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already not_determined. Not updating persistent storage.
2020-10-23 10:45:03.131993+0300 World Run[569:6752020-10-23 10:45:03.133002+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager requestSessionStartGeofenceRefresh] Geofence tracking disabled, not requesting geofences
2020-10-23 10:45:03.141150+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKLocationManager logSingleLocation] Automatic location tracking disabled, not logging single location.
2020-10-23 10:45:03.141354+0300 World Run[569:67393] [APPBOY][DEBUG] -[Appboy registerApplication:didFinishLaunchingWithOptions:] Method called with launchOptions: (null)
61] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.185092+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager ensureRequestQueueProcessingIsScheduled]_block_invoke FlushTimer is scheduled and valid: 1 with interval 10.000000
2020-10-23 10:45:03.204261+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:03.228594+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already not_determined. Not updating persistent storage.
2020-10-23 10:45:03.229125+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.229182+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:03.229227+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already not_determined. Not updating persistent storage.
2020-10-23 10:45:03.229264+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.280979+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:03.281108+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already not_determined. Not updating persistent storage.
2020-10-23 10:45:03.281300+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 0. Not updating persistent storage.
2020-10-23 10:45:03.281431+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:03.281544+0300 World Run[569:67561] Permission granted.
2020-10-23 10:45:03.286911+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Storing new push auth status: provisional. Previous status: not_determined
2020-10-23 10:45:03.287634+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKManager processRequestQueueImmediately] Requesting immediate processing of request queue in manager.
2020-10-23 10:45:03.288006+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:03.288114+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKRequestDispatcher isNetworkRequestRequired] Request is already in progress, returning. You must re-consume the queue later.
2020-10-23 10:45:03.288384+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Storing new foreground push enabled flag value: 1
2020-10-23 10:45:03.290011+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKManager processRequestQueueImmediately] Requesting immediate processing of request queue in manager.
2020-10-23 10:45:03.291818+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:03.291973+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKRequestDispatcher isNetworkRequestRequired] Request is already in progress, returning. You must re-consume the queue later.
2020-10-23 10:45:03.292162+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Storing new push display options.
2020-10-23 10:45:03.293108+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKManager processRequestQueueImmediately] Requesting immediate processing of request queue in manager.
2020-10-23 10:45:03.293394+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:03.293497+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKRequestDispatcher isNetworkRequestRequired] Request is already in progress, returning. You must re-consume the queue later.
2020-10-23 10:45:03.390164+0300 World Run[569:67393] IAB.close() called but it was already closed.
2020-10-23 10:45:03.452098+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKReachability networkStatusForFlags:] Reachability Flag Status: -R ------- networkStatusForFlags
2020-10-23 10:45:03.452185+0300 World Run[569:67393] [APPBOY][DEBUG] void ReachabilityCallback(SCNetworkReachabilityRef, SCNetworkReachabilityFlags, void *) Reachability changed to: Reachable
2020-10-23 10:45:03.452228+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKReachability networkStatusForFlags:] Reachability Flag Status: -R ------- networkStatusForFlags
2020-10-23 10:45:03.474025+0300 World Run[569:67393] [APPBOY][DEBUG] -[Appboy registerDeviceToken:] Method called with token: {length = 32, bytes = 0x56125a59 2e0795d9 6c554c55 8589c934 ... 4d28fc4b 08451968 }
2020-10-23 10:45:03.474802+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager ensureRequestQueueProcessingIsScheduled] Got call to ensure request queue processing was scheduled, but we already have a valid timer running. Ignoring.
2020-10-23 10:45:03.475140+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager processRequestQueueImmediately] Requesting immediate processing of request queue in manager.
2020-10-23 10:45:03.476197+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:03.476273+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher isNetworkRequestRequired] Request is already in progress, returning. You must re-consume the queue later.
2020-10-23 10:45:04.188718+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKServerResponseHandler responseStatusCodeIsValid:] Connection response code 201
2020-10-23 10:45:04.189929+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKManager requestContentCardsSync] Requesting content cards sync.
2020-10-23 10:45:04.190627+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:04.190876+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher isNetworkRequestRequired] Request is already in progress, returning. You must re-consume the queue later.
2020-10-23 10:45:04.191291+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKTriggerManager receiveTriggersFromNotification:] Received triggers array: (
)
2020-10-23 10:45:04.191437+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKTriggerManager reportAnyPendingPushClickTrigger] Trigger sync received. Firing any waiting push click trigger events.
2020-10-23 10:45:04.191557+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKServerResponseHandler processResponse:withData:withInFlightRequest:] Received response with body: {"feed":[],"triggers":[],"config":{"time":1603349906,"attributes_blacklist":[],"events_blacklist":[],"purchases_blacklist":[],"messaging_session_timeout":21600,"content_cards":{"enabled":true}}}
2020-10-23 10:45:04.192361+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKTriggerManager handleTriggerFromNotification:]_block_invoke Trigger sync in progress, adding trigger event to pending list.
2020-10-23 10:45:04.192442+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKService request:finishedSuccessfully:] ABKDataServerRequest finished, completed successfully: 1
2020-10-23 10:45:04.192533+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKService dataRequest:finishedSuccessfully:] ABKDataServerRequest asked for feed: 1, triggers: 1, config: 1
2020-10-23 10:45:04.192645+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:04.192766+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKReachability networkStatusForFlags:] Reachability Flag Status: -R ------- networkStatusForFlags
2020-10-23 10:45:04.193103+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request HTTP method POST to https://sdk.iad-03.appboy.com/api/v3/content_cards/sync
2020-10-23 10:45:04.193191+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKTriggerManager processTriggerEvent:] No matching actions for trigger event open
2020-10-23 10:45:04.193270+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-ContentCardsRequest: true
2020-10-23 10:45:04.193329+0300 World Run[569:67561] [APPBOY][DEBUG] -[ABKTriggerManager processTriggerEvent:] No matching actions for trigger event push_click
2020-10-23 10:45:04.193357+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header Content-Type: application/json
2020-10-23 10:45:04.193447+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-DataRequest: true
2020-10-23 10:45:04.193506+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-Api-Key: xxx
2020-10-23 10:45:04.193991+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request connection body: {"api_key":"xxx","app_version":"5.0.0","time":1603439104.1929531,"last_card_updated_at":0,"device_id":"B5D065F8-BCA5-44B1-840F-1C0667B3CA3F","app_version_code":"5.0.0.0","last_full_sync_at":0,"sdk_version":"3.27.0","sdk_flavor":"cordova"}
2020-10-23 10:45:04.365688+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKServerResponseHandler responseStatusCodeIsValid:] Connection response code 201
2020-10-23 10:45:04.366013+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKPersistentData updateContentCards:forUser:] There are no new content cards
2020-10-23 10:45:04.366063+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKServerResponseHandler processResponse:withData:withInFlightRequest:] Received response with body: {"cards":[],"last_full_sync_at":0,"last_card_updated_at":0}
2020-10-23 10:45:04.366148+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKService request:finishedSuccessfully:] ABKContentCardsSyncServerRequest finished, completed successfully: 1
2020-10-23 10:45:04.366438+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKRequestDispatcher consumeNextRequestInQueueIfWeHaveInternetConnectivity] Attempting to consume queue.
2020-10-23 10:45:04.366710+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKReachability networkStatusForFlags:] Reachability Flag Status: -R ------- networkStatusForFlags
2020-10-23 10:45:04.369974+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request HTTP method POST to https://sdk.iad-03.appboy.com/api/v3/data
2020-10-23 10:45:04.370140+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header Content-Type: application/json
2020-10-23 10:45:04.370315+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] HTTP Header X-Braze-Api-Key: xxx
2020-10-23 10:45:04.370389+0300 World Run[569:67393] [APPBOY][DEBUG] +[ABKUtilityFunctions printRequestDetails:] Request connection body: {"device":{"remote_notification_enabled":true,"ios_push_auth":"provisional","ios_push_display_options":{"ios_critical_alert":"not_supported","ios_badge":"disabled","ios_notification_center":"enabled","ios_lock_screen":"disabled","ios_alert":"disabled","ios_sound":"disabled","ios_car_play":"not_supported"}},"app_version":"5.0.0","time":1603439104.3696918,"device_id":"B5D065F8-BCA5-44B1-840F-1C0667B3CA3F","api_key":"xxx","app_version_code":"5.0.0.0","attributes":[{"push_token":"56125a592e0795d96c554c558589c934594e2087970b48f84d28fc4b08451968"}],"sdk_version":"3.27.0","sdk_flavor":"cordova"}
2020-10-23 10:45:04.371049+0300 World Run[569:67557] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.372005+0300 World Run[569:67557] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.372072+0300 World Run[569:67557] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.372890+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.380862+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.380940+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.381301+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.381353+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.381402+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.383817+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.383873+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.383923+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.383963+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.384000+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.385733+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.386222+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.386266+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.386309+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.386351+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.387058+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.387122+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.387568+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storePushAuthStatus:withFlush:] Stored push auth status was already provisional. Not updating persistent storage.
2020-10-23 10:45:04.387612+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings storeIsForegroundPushEnabled:withFlush:] Stored foreground push enabled flag value was already 1. Not updating persistent storage.
2020-10-23 10:45:04.388614+0300 World Run[569:67561] [APPBOY][DEBUG] +[ABKPushSettings readAndStoreCurrentPushDisplayOptions:withFlush:] Stored push display options did not change. Not updating persistent storage.
2020-10-23 10:45:04.785525+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKServerResponseHandler responseStatusCodeIsValid:] Connection response code 201
2020-10-23 10:45:04.785736+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKServerResponseHandler processResponse:withData:withInFlightRequest:] Received response with body: {}
2020-10-23 10:45:04.786397+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKService request:finishedSuccessfully:] ABKDataServerRequest finished, completed successfully: 1
2020-10-23 10:45:04.786445+0300 World Run[569:67393] [APPBOY][DEBUG] -[ABKService dataRequest:finishedSuccessfully:] ABKDataServerRequest asked for feed: 0, triggers: 0, config: 0
Bucimis commented 4 years ago

@vandres I'm able to see a push token get sent up to Braze in those logs. One thing to keep in mind is that on iOS 12+, the SDK will ask for "provisional push authorization", meaning that you will be allowed to send non-interruptive notifications to the device without the user accepting push notifications via a prompt. On iOS 12+ in a provisional auth flow, the prompt is actually never shown. I would test again and see if you're able to receive push in the notification center for your users.

For further support on getting push working, I'd also reach out and contact support@braze.com

vandres commented 4 years ago

@Bucimis Thanks for your support. I already tried sending multiple push throughout the day. How can I tell the plugin to ask for the real permission? What is a non-interruptive notification? I also contacted support, and they told me to be in contact here with you :D

Bucimis commented 4 years ago

@vandres gotcha. Non-interruptive push is another way of saying "quiet push" - push which doesn't cause sound/vibration and appears quietly inside of the notification center.

The way the Provisional Auth flow works, when users see the first notification from your app in the center, iOS will ask them if they want to continue to receive push notifications from your app - and at that point they can opt-in to receiving interruptive (or "loud") push.

We recommend using this flow as its the standard flow Apple is directing folks towards. At the moment, the plugin doesn't support the old dialog-based flow for iOS 12+, but we could potentially put that on the roadmap.

vandres commented 4 years ago

@Bucimis We definitely need "loud" Push to inform users about things going on. These users might not use the app for a long time, so silent is the wrong way for us.

I have to ask another silly question. What is the notification center? Where can I see this silent message?

vandres commented 4 years ago

@Bucimis Nevermind, I found it.

I will talk to our project manager. How long would it take to include the setLanguage() and the "loud" push request?

Bucimis commented 4 years ago

@vandres in a normal cycle I'd expect 3-6 weeks but if this blocking a critical aspect of your Braze integration per your PM conversation let us know and we can expedite

vandres commented 4 years ago

@Bucimis Thanks! I talked to him. The Push and Language has no priority at the moment. But the "In-App Purchase" activation is a blocker for us, since it affects our build process

Bucimis commented 4 years ago

@vandres thanks for the context - we'll get that "In-App Purchase" fix released next week

vandres commented 4 years ago

@Bucimis Thanks again!