No description, website, or topics provided.
Objective-C Swift Ruby
Latest commit 27153e0 Dec 23, 2016 @g8y3e g8y3e fixed local notification
Permalink
Failed to load latest commit information.
reaction_sdk fixed local notification Dec 23, 2016
.gitignore added project Dec 23, 2016
LICENSE added source code Nov 28, 2016
README.md fixed readme.md Dec 23, 2016
ReActionSDK.podspec fixed example Dec 10, 2016

README.md

ironSource.ReAction SDK for IOS

License Pods

Installation

Installation from CocoaPods.

Add dependency in your pod file

use_frameworks!

pod 'ReActionSDK'

pre_install do |installer|
    def installer.verify_no_static_framework_transitive_dependencies; end
end

Using the IronSource ReAction API

Add methods to your application in Swift:

import ReActionSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, GCMReceiverDelegate {
    
    func application(application: UIApplication,
                     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
        ISReactionApp.registerGCMServiceWithApplication(application,
                                                        deviceToken:deviceToken)
    }
    
    func applicationDidBecomeActive(application: UIApplication) {
        ISReactionApp.applicationDidBecomeActive(application)
    }
    
    func applicationDidEnterBackground(application: UIApplication) {
        ISReactionApp.applicationDidEnterBackground(application)
    }
    
    func application(application: UIApplication,
                     didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
        ISReactionApp.receiveRemoteNotificationWithApplication(application,
                                                               userInfo:userInfo);
    }
    
    func application(application: UIApplication,
                     didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
                  fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
        ISReactionApp.receiveRemoteNotificationWithApplication(application,
                        userInfo:userInfo, fetchCompletionHandler:completionHandler)
    }
    
    func application(application: UIApplication,
                     didReceiveLocalNotification notification: UILocalNotification) {
        ISReactionApp.receiveLocalNotificationWithApplication(application,
                                                              notification:notification);
    }
}

Add methods to your application in Objective-c

In application header add GCMReceiverDelegate interface delegate:

@import ReActionSDK;

@interface AppDelegate : UIResponder <UIApplicationDelegate, GCMReceiverDelegate>

And methods in implementation:

@implementation AppDelegate
  -(void)application: (UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:
  (NSData*)deviceToken {
    [ISReactionApp registerGCMServiceWithApplication:application
                                         deviceToken:deviceToken];
  }
 
  -(void)applicationDidBecomeActive: (UIApplication*)application {
    [ISReactionApp applicationDidBecomeActive:application];
  }

  -(void)applicationDidEnterBackground: (UIApplication*)application {
    [ISReactionApp applicationDidEnterBackground:application];
  }
 
  -(void)application: (UIApplication*)application didReceiveRemoteNotification:
  (NSDictionary*)userInfo {
    [ISReactionApp receiveRemoteNotificationWithApplication:application
                                                   userInfo:userInfo];
  }
 
  -(void)application: (UIApplication*)application
  didReceiveRemoteNotification: (NSDictionary*)userInfo
  fetchCompletionHandler: (void (^)(UIBackgroundFetchResult))completionHandler {
    [ISReactionApp receiveRemoteNotificationWithApplication:application
                                                   userInfo:userInfo
                                                   fetchCompletionHandler:completionHandler];
  }
 
  - (void)application: (UIApplication *)application
  didReceiveLocalNotification:(nonnull UILocalNotification *)notification {
    [ISReactionApp receiveLocalNotificationWithApplication:application
                                              notification:notification];
  }
@end

Example of using SDK in Swift:

import ReactionSDK

class ViewController: UIViewController {
    var reactionSDK_: ISReaction?

    override func viewDidLoad() {
        super.viewDidLoad()

        // initialize reaction-sdk api object
        self.reactionSDK_ = ISReaction(senderID: "<YOUR_SENDER_ID>",
                                 applicationKey: "<YOUR_APP_KEY>",
                                        isDebug: true)
    }
}

Example of using SDK in Objective-C:

@import ReActionSDK;

ISReaction* reaction_;

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    reaction_ = [[ISReaction alloc] initWithSenderID:@"<YOUR_SENDER_ID>"
                                      applicationKey:@"<YOUR_APP_KEY>"
                                             isDebug:true];
    
}
@end

Example

You can use our example

License

MIT