0

We are using Offline Login in our application. We are using the below code to do for un-registering the Device from MFP Server while Logging Out of our application.

function unregisterDevice() {
            const deferred = $q.defer();

            WLAuthorizationManager.obtainAccessToken('push.mobileclient').then(token => MFPPush.unregisterDevice((successResponse) => {
                deferred.resolve(successResponse);
            }, (failureResponse) => {
                pelLogger.warn('Failed to unregister from push notifications', failureResponse);
                deferred.resolve(failureResponse);
            }), (error) => {
                deferred.resolve(error);
            });

                return deferred.promise;
}

The Above code WLAuthorizationManager.obtainAccessToken('push.mobileclient') doesn't return anything at some point of time no failure / error / success which causes our application to just look ideal. It was said in Feb 2018 that this code is written because

/* * NOTE: in the code below MFPPush API calls are wrapped with "WLAuthorizationManager.obtainAccessToken("push.mobileclient")". * This is due to a defect in the current release of the product. */

Do we still need to do that ? even after a year and so many updates.

Kawinesh S K
  • 3,148
  • 1
  • 16
  • 29

1 Answers1

1

Invoking WLAuthorizationManager.obtainAccessToken('push.mobileclient') before all MFPPush API calls , is not mandatory.

If you are trying to invoke the unregister API while the device is offline, note that this will not work.

Vivin K
  • 2,681
  • 1
  • 11
  • 14