For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Update the iOS code
After updating the iOS framework and making necessary configuration changes, a number of issues can be relevant to our specific application code.
The iOS API changes are listed in the Table 1.
For some sample code for creating the client and accessing the server with the new V8.0.0 client for iOS, see Create some initial code in iOS.
Table 1. Discontinued iOS Objective C APIs API element Migration path [WLClient getWLDevice][WLClient transmitEvent:] [WLClient setEventTransmissionPolicy]
[WLClient purgeEventTransmissionBuffer]
Geolocation removed. Use native iOS or third-party packages for GeoLocation. WL.Client.getUserInfo(realm, key) WL.Client.updateUserInfo(options)
No replacement. WL.Client.deleteUserPref(key, options) No replacement. We can use an adapter and the MFP.Server.getAuthenticatedUser API to manage user preferences. [WLClient getRequiredAccessTokenScopeFromStatus] Use WLAuthorizationManager obtainAccessTokenForScope. [WLClient login:withDelegate:] Use WLAuthorizationManager login. [WLClient logout:withDelegate:] Use WLAuthorizationManager logout. [WLClient lastAccessToken] [WLClient lastAccessTokenForScope:]
Use WLAuthorizationManager obtainAccessTokenForScope. [WLClient obtainAccessTokenForScope:withDelegate:] [WLClient getRequiredAccessTokenScopeFromStatus:authenticationHeader:]
Use WLAuthorizationManager obtainAccessTokenForScope. [WLClient isSubscribedToAdapter:(NSString *) adaptereventSource:(NSString *) eventSource Use Objective-C client-side push API for iOS apps from the IBMMobileFirstPlatformFoundationPush framework. For more information, see Migrating to push notifications from event source-based notifications. [WLClient - (int) getEventSourceIDFromUserInfo: (NSDictionary *) userInfo] Use Objective-C client-side push API for iOS apps from the IBMMobileFirstPlatformFoundationPush framework. For more information, see Migrating to push notifications from event source-based notifications. [WLClient invokeProcedure: (WLProcedureInvocationData *) ] Deprecated. Use WLResourceRequest instead. [WLClient sendUrlRequest:delegate:] Use [WLResourceRequest sendWithDelegate:delegate] instead. [WLClient (void) logActivity:(NSString *) activityType] Removed. Use an Objective C logger. [WLSimpleDataSharing setSharedToken: myName value: myValue] [WLSimpleDataSharing getSharedToken: myName]]
[WLSimpleDataSharing clearSharedToken: myName]
Use the OS APIs to share tokens across applications. BaseChallengeHandler.submitFailure(WLResponse *)challenge Use BaseChallengeHandler.cancel(). BaseProvisioningChallengeHandler No replacement. Device provisioning is now handled automatically by the security framework. ChallengeHandler For custom gateway challenges, use GatewayChallengeHandler. For MobileFirst security-check challenges, use SecurityCheckChallengeHandler. For more information about the V8.0.0 challenge-handler APIs, see Client security APIs. WLChallengeHandler Use SecurityCheckChallengeHandler. For more information about the V8.0.0 challenge-handler APIs, see Client security APIs. ChallengeHandler.isCustomResponse() Use GatewayChallengeHandler.canHandleResponse(). ChallengeHandler.submitAdapterAuthentication Implement similar logic in your challenge handler. For custom gateway challenge handlers, use GatewayChallengeHandler. For MobileFirst security-check challenge handlers, use SecurityCheckChallengeHandler.
Parent topic: Migrating existing native iOS applications