• 授权协议:Apache
  • 开发厂商:-
  • 软件语言:Swift
  • 更新日期:2015-01-27
aerogear-ios-push

aerogear-ios-push 是为 AeroGear UnifiedPush Server 提供的 iOS 消息推送 SDK 开发包。

aerogear-ios-push 项目简介

aerogear-ios-push 是为 AeroGear UnifiedPush Server 提供的 iOS 消息推送 SDK 开发包。示例代码:  func application(application: UIApplication!, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData!) {
     // setup registration
    let registration = AGDeviceRegistration(serverURL: NSURL(string: "<# URL of the running AeroGear UnifiedPush Server #>")!)

    // attemp to register
    registration.registerWithClientInfo({ (clientInfo: AGClientDeviceInformation!) in
        // setup configuration
        clientInfo.deviceToken = deviceToken
        clientInfo.variantID = "<# Variant Id #>"
        clientInfo.variantSecret = "<# Variant Secret #>"

        // apply the token, to identify THIS device
        let currentDevice = UIDevice()

        // --optional config--
        // set some 'useful' hardware information params
        clientInfo.operatingSystem = currentDevice.systemName
        clientInfo.osVersion = currentDevice.systemVersion
        clientInfo.deviceType = currentDevice.model
        },

        success: {
            println("UnifiedPush Server registration succeeded")
        },
        failure: {(error: NSError!) in
            println("failed to register, error: \(error.description)")
        })
}

aerogear-ios-push 评论内容