Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The SDK ZIP file includes an iOS sample project that demonstrates the basic usage of each of the Cloud APIs. To run the sample, register a new application in Dashboard to obtain the necessary service application. You will then copy the key into the imported sample project's application delegate, then run the application.

...

To import the completed APSCloudExample project:

  1. In Xcode, open the the appcelerator-sdk-ios-<VERSION>/examples/APSCloudExample.xcodeproj.
  2. Open Open AppDelegate.m, add the code below to your application delegate's application:didFinishLaunchingWithOptions method, and replace << YOUR APP KEY >> with the application key you copied to your clipboard previously.

    Code Block
    languagejs
    [[APSServiceManager sharedInstance] enableWithAppKey:@"<< YOUR APP KEY >>"];
  3. Run the application on an iOS device or simulator.

...

  • Create a new user by selecting Users > Create User. Enter a username, password, and password confirmation and then click Create. If the user is created successfully, the following dialog is shown:
  • View the newly created user in Dashboard:
    1. Log into the AMPLIFY Platform.
    2. Select Dashboard on the Dashboard tile.
    3. Select your MBS application from the Apps tab.
    4. Select Manage Data, then click Users in the Manage Data Objects table. You should see the user you created listed in the Users table.
       

...

The iOS framework includes a collection of classes whose methods map to individual REST API method endpoints. For example, the APSUsers create method that corresponds to the /users/create.json method endpoint.

...

The first parameter of each Cloud API method is a NSDictionary object that contains the of parameters to send with the request. For example, the APSPhotos show method takes a photo_id parameter whose value is, naturally, the ID of the photo to show.

...

The second parameter of each method call is a block that is passed to an APSResponse whose properties contain information about the response. For instance, the success property contains a boolean indicating if the method call was successful or not; , the response property returns a JSON-encoded object with the results of the method call.

...

Note that the block will be called on the thread that on which the request was started on.

Example: APSUsers login call with response handler

...

Working with push notifications

The APSPushNotifications class class lets your application subscribe, send, and receive push notifications. To use the class:

...