You may remember that when we generated the app using forceios we used the Connected App that came with sample template. In this unit, you'll create a new Salesforce Connected App in Salesforce, grab "App ID"(aka Consumer key) and Callback URL from there and update them in our sample app.
Click Continue and wait for 5-10 minutes.
Allow from 2-10 minutes for your changes to take effect on the server before using the connected app.
App ID (Connected App's "Consumer Key") and the Callback URL is stored in the native app's AppDelegate.m
file. We just need to change those values and restart everything.
AppDelegate.swift
under SwiftSample > Classes
folderRemoteAccessConsumerKey
's value to match the Consumer Key copied from the connected app we created earlier.Change OAuthRedirectURI
's value to match the Callback URL from the connected app we created earlier.
Save.
Switch to the iOS Simulator.
Notice that next OAuth screen shows SwiftSample. This means our app now uses the new Connected App configuration.
Press "Approve" in the next OAuth screen.
Note that you need to reset the simulator because Sample app caches old Connected App's information. Sample app also doesn't have "Log off" functionality.