MBS for DOEC Client Application Recovery Example

MBS for DOEC clients can run on the iOS platform. The registration recovery is the same as RBS registration recovery. However, subscription recovery is different.

There are two scenarios:
  1. SAP Mobile Server is restored to a point in time where the client unsubsribed - after SAP Mobile Server is restored, the client status is unsubsribed on the server side, but the client status may be subscribed or unsubscribed. Therefore, the client application should check the client subscription status: if subscribed, call Unsubscribe(this leads to unsubscribe failure message because server does not have client subscribe info), then call Subscribe, if unsubscribed, call Subscribe:
    if ([end2end_rdbEnd2end_rdbDB isSubscribed])
        {
            [end2end_rdbEnd2end_rdbDB unsubscribe];
            // wait for onUnsubscribeSuccess method in CallbackHandler is called
        }
        
        [end2end_rdbEnd2end_rdbDB subscribe];
        // wait for onSubscribeSuccess method in CallbackHandler is called
  2. SAP Mobile Server is restored to a point in time where the client subsribed - after SAP Mobile Server is restored, the client status is subsribed on the server side. For this scenario, the client can check if it’s subsribed. If not, call Subscribe to recover. After SAP Mobile Server is restored, the SAP Control Center Administrator can also delete the subscription from SAP Mobile Server. This time, SAP Mobile Server sends an unsubscribe message to the client application. When the client application is running, it receives the unsubscribe message, then the client generated database calls DB.CleanAllData() to clean the client data and update status to unsubscribed. The client application needs to then call Subscribe:
    // sleep some time to receive server unsubscribe messages when application starts up
        if (![end2end_rdbEnd2end_rdbDB isSubscribed])
        {
            [end2end_rdbEnd2end_rdbDB subscribe];
        }