Add and Configure the Live Experience Widget for your iOS App in Objective-C
This topic provides guidelines and an overview for using Objective-C to add and configure the widget in your iOS app.
Before you start
Make sure your development environment is properly set up (see Preparing Your iOS App for the Live Experience Widget). This procedure builds on the concepts and detailed procedure for including and configuring the widget using the Swift programming language. You should read and familiarize yourself with Adding and Configuring the Live Experience Widget for your iOS App before continuing.In our experience, Xcode is slow to fully initialize the Live Experience framework when working in Objective-C.
Use the following procedure as a reference for educating Xcode into progressively exploring the framework. You should only need to run through this procedure one time. Once Xcode has fully discovered the Live Experience framework in one project, you can add and configure the Live Experience widget in your other projects.
Here's what to do
Results:
If Xcode is suggesting classes and properties belonging to the Live Experience framework, then you can carry on adding and configuring the Live Experience widget to your other Objective-C projects.If Xcode does not suggest auto-completing the classes and properties from the Live Experience frameworks, check that you are building the project on a real device or on a generic iOS device, not an iOS simulator. If that doesn't work, try restarting Xcode.
Controller.shared.service.userID = @"bob@example.com";
Controller.shared.service.tenantID = @"MyTenantID";
Controller.shared.service.clientID = @"clientID";
Controller.shared.service.authToken = @”MyAuthtoken”;
Controller.shared.service.address = @"cloudURL";
[Controller.shared.contextAttributes setValue: @"Bob Dobbs" forKey: @"fullName"];
[Controller.shared.contextAttributes setValue: @"bob@example.com" forKey: @"email"];
[Controller.shared.contextAttributes setValue: @"202-555-0171" forKey: @"phone"];
[Controller.shared.contextAttributes setValue: @"Support Tab" forKey: @"appLocation"];