Latest 0.3.0
Homepage https://github.com/alexandruchis1987/NVBBeaconSDK
License MIT
Platforms ios 8.0, requires ARC
Dependencies AFNetworking, Parse
Frameworks UIKit
Authors

Please direct all Support Questions and Concerns to [email protected]

Requirements

iOS8+

Installation

NVBBeaconSDK is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NVBBeaconSDK"

Credentials

  1. Log in the dashboard http://admin.invibe.me/ with your credentials

  2. Navigate on the left to the applications area

  3. Take a look at the client id and client secret, you will need them later

Usage

In the import section for your application delegate file add

#import <NVBBeaconSDK/NVBBeaconSDK.h>

If your app already has push notifications enabled send us the exported .p12 ssl for push notifications(development + production) files to [email protected] and wait for our confirmation that is enabled. If your app doesn’t have push notifications enabled check How To Configure Push Notifications

Make sure your .plist file contains the following line of code

<key>UIBackgroundModes</key>
<array>
    <string>remote-notification</string>
</array>

Before the last line of ‘didFinishLaunchingWithOptions’ method from the application delegate file, request push notification authorization

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

//Register to receive push notifications
#ifdef __IPHONE_8_0
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

#endif

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];

    return YES;
}

Start the Beacon SDK services (Use the client id and client secret key from your account on your http://admin.invibe.me/)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

//Register to receive push notifications
#ifdef __IPHONE_8_0
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

#endif

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];

    [NVBBeaconSDK setClientId:@“YOUR_CLIENT_ID” andClientSecret:@“YOUR_CLIENT_SECRET_KEY”];

    return YES;
}

Forward push notifications method calls to the Beacon SDK

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    if (deviceToken)
    {
        NSLog (@"Successfully registered for remote notifications");
        [NVBBeaconSDK didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
    }
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
    if (error.code == 3010) {
        NSLog(@"Push notifications are not supported in the iOS Simulator.");
    } else {
        NSLog(@"Failed to register for remote notifications %@", error);
    }
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {

    //Forward the call to the beacon sdk as well
    [NVBBeaconSDK didReceiveRemoteNotification:userInfo];
}

-(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
    //Forward the call to the beacon sdk as well
    [NVBBeaconSDK didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];

}

Reference App – Example

We provide Example as a generic reference on how to config and start the sdk

The Example app is used as a simple reference app. It will evolve over time, along with other example apps — stay tuned for that!

Author

Alexandru Chis, [email protected]

License

NVBBeaconSDK is available under the MIT license. See the LICENSE file for more info.

=======

Please direct all Support Questions and Concerns to [email protected]

Latest podspec

{
    "name": "NVBBeaconSDK",
    "version": "0.3.0",
    "summary": "Framework used to interract with beacons.",
    "description": "You can integrate it and display beacons around you.",
    "homepage": "https://github.com/alexandruchis1987/NVBBeaconSDK",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Alexandru Chis": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/alexandruchis1987/NVBBeaconSDK.git",
        "tag": "0.3.0"
    },
    "source_files": [
        "NVBBeaconSDK",
        "NVBBeaconSDK/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "frameworks": "UIKit",
    "requires_arc": true,
    "dependencies": {
        "AFNetworking": [],
        "Parse": []
    }
}

Pin It on Pinterest

Share This