Registering the iOS Client

Register and enable your iOS device clients to receive push notifications.

  1. In Sybase Control Center configure push notification:
    1. Select Application > Applications > select the application > Properties.
    2. In the Properties window, select Push Configuration > Add.
    3. In the Push Configurations window, enter the Name, Domain, Type (APNS), Server (APNS Server), Port, Feedback server, and Feedback port.
    4. Browse and upload an Apple Push Notification Service p12 certificate, and enter the certificate password.
    5. Click OK to save.
  2. Enable push notifications in the application itself:
    1. Call the registerForRemoteNotificationTypes: method.
    2. In your delegate, implement the application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken: and application:(UIApplication *)app didRegisterReceiveRemoteNotification: methods to receive the device token and notifications.
    3. Create an application connection, and include the ApnsDeviceToken, and DeviceType properties.
      PUT http://{domain-host-port}/odata/applications/v1/{appid}/Connections/('{appcid}')
      HTTP Headers "Content-Type" = "application/atom+xml"
      Body:
      <?xml version='1.0' encoding='utf-8'?>
      <entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="http://host:port/odata/applications/v1/com.example.IOS/">
        <id>http://host:port/odata/applications/v1/com.example.IOS/Connections('32552613-470f-45e0-8acc-b7d73d501682')</id>
        <link rel="edit" title="Connection" href="Connections('32552613-470f-45e0-8acc-b7d73d501682')" />
        <category term="applications.Connection" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <content type="application/xml">
          <m:properties>
            <d:ApnsDeviceToken>{APNS device token received by the application from APNS}</d:ApnsDeviceToken>
            <d:DeviceType>iPhone</d:DeviceType>
          </m:properties>
        </content>
      </entry>
  3. Native mobile listener should be implemented by the application to get the notification.