All Products
Search
Document Center

Mobile Platform as a Service:FAQ

Last Updated:May 25, 2021

Common questions for iOS

How to set the Data Center to user mode?

Answer: Applications that access the mPaaS use their own account systems. If you want to manage user mode data by using the unified storage component, notify the unified storage component first. The unified storage component switches the user database and then notifies other business layers.

  1. [[APDataCenter defaultDataCenter] setCurrentUserId:userId];

When you log off, you do not need to call the setCurrentUserId method. The unified storage component will continue to open the database used by the last user.

Is the unified storage component thread-safe?

Answer: Yes. All the data storage interfaces of the unified storage component are thread-safe and can be called in all threads.

How do I resolve the conflict with the Baidu Map SDK?

Description: When you integrate your application with a certain version of Baidu Map SDK, a crash may occur, as shown in the following figure.

baidu-ap

Answer: Complete the following configurations when you initialize your application. Make sure that the version of the mPaaS is 10.1.32 or later.

  1. #import <MPDataCenter/APDataCenter.h>
  2. // For example, add the following code in the application initialization method.
  3. APDataCenter.compatibility = YES;

How does archiveObject store and read variables?

Answer: The following code snippets show how archiveObject stores and reads variables:

  • Store objects persistently:
    1. MPCodingData *obj = [MPCodingData new];
    2. obj.name = @"Amelia";:
    3. obj.age = 1;
    4. [APUserPreferences archiveObject:obj forKey:@"archObjKey" business:dataBusiness];

Read variables from the unified storage component:

  1. MPCodingData *encodeObj = [APUserPreferences objectForKey:@"archObjKey" business:dataBusiness];