Latest 0.0.1
Homepage https://github.com/ironSource/reaction-ios
License MIT
Platforms ios 8.0, requires ARC
Dependencies AtomSDK, Google/CloudMessaging
Authors

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

Latest podspec

{
    "name": "Reaction",
    "version": "0.0.1",
    "summary": "Reaction",
    "description": "Reaction SDK - GCM notifications",
    "homepage": "https://github.com/ironSource/reaction-ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "g8y3e": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ironSource/reaction-ios.git",
        "tag": "minor_fixes"
    },
    "source_files": "reaction_sdk/ReactionSDK/ReactionSDK/**/*.{h,m}",
    "public_header_files": [
        "reaction_sdk/ReactionSDK/ReactionSDK/Reaction.h",
        "reaction_sdk/ReactionSDK/ReactionSDK/ReactionApp.h"
    ],
    "requires_arc": true,
    "dependencies": {
        "AtomSDK": [],
        "Google/CloudMessaging": []
    },
    "xcconfig": {
        "FRAMEWORK_SEARCH_PATHS": "$(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AtomSDK" "$PODS_CONFIGURATION_BUILD_DIR/sqlite3" "${PODS_ROOT}/GoogleIPhoneUtilities/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleNetworkingUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks/frameworks"",
        "GCC_PREPROCESSOR_DEFINITIONS": "$(inherited) COCOAPODS=1",
        "HEADER_SEARCH_PATHS": "$(inherited) ${PODS_ROOT}/Google/Headers $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/GGLInstanceID" "${PODS_ROOT}/Headers/Public/Google" "${PODS_ROOT}/Headers/Public/GoogleCloudMessaging" "${PODS_ROOT}/Headers/Public/GoogleIPhoneUtilities" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities"",
        "LD_RUNPATH_SEARCH_PATHS": "$(inherited) "@executable_path/Frameworks" "@loader_path/Frameworks"",
        "LIBRARY_SEARCH_PATHS": "$(inherited) "${PODS_ROOT}/GGLInstanceID/Libraries" $(inherited) "${PODS_ROOT}/Google/Libraries" $(inherited) "${PODS_ROOT}/GoogleCloudMessaging/Libraries"",
        "OTHER_CFLAGS": "$(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AtomSDK/AtomSDK.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/sqlite3/sqlite3.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/GGLInstanceID" -isystem "${PODS_ROOT}/Headers/Public/Google" -isystem "${PODS_ROOT}/Headers/Public/GoogleCloudMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleIPhoneUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleNetworkingUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities"",
        "OTHER_LDFLAGS": "$(inherited) -ObjC -l"GGLCloudMessaging" -l"GGLCore" -l"GGLInstanceIDLib" -l"GcmLib" -l"sqlite3" -l"stdc++" -l"z" -framework "AddressBook" -framework "AssetsLibrary" -framework "AtomSDK" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreMotion" -framework "GoogleIPhoneUtilities" -framework "GoogleInterchangeUtilities" -framework "GoogleNetworkingUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "MessageUI" -framework "Security" -framework "SystemConfiguration" -framework "sqlite3""
    }
}

Pin It on Pinterest

Share This