0

since Mobile Push SDK (8.1.0) and SFMCSDK (1.1.0) according to the documentation, all access to the PushInterface instance should be done via

SFMCSdk.requestPushSdk { mp in
   // using mp is now safe
}

After adopting this new API for all calls on mp, we found out that when the user has not been asked for permissions or denied push permissions the completion block is NOT called.

This is not what I would expect from an API like this and would result in a hang for any calling code until push permissions have been granted. Do you have any suggestions how to handle this wisely?

Using something like this before any access might be possible but seems to defeat the purpose of SFMCSdk.requestPushSdk(...).

var isPushSDKReady: Bool {
    SFMCSdk.mp.getStatus() == .operational
}

Another question I have, concerning this new API, is related to accessing the Inbox. From my understanding, the Inbox can be used without granting push permission. However, the way this API is implemented is suggesting this. It is not possible to access the Inbox (APIs) on mp without the user granting push permission. Is this really intended from your side or are we allowed to get Inbox messages without prior requesting access to the PushInterface?

1 Answer 1

1

In order for the MarketingCloudSDK to function correctly, it must be in a Operational state. The requestPushSDK API is designed to queue items, and once the SDK is operational, the queued items are processed. It's important to note that this process doesn't verify Push permissions.

While push permissions are not necessary for the Inbox only messages, the SDK must be operational. It is advisable to investigate the factors causing the SDK to be non-operational.

Thanks Prakashini

1
  • 1
    This actually helped in finding the problem. The SDK was not operational because it was not initialised properly. We built a guard-statement in front of the SDK Setup Method which skipped the initialisation when the user has not given push permissions or denied push permissions. After I removed the guard-statement everything was working as expected. Commented Jan 25 at 13:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .