CocoaPods trunk is moving to be read-only. Read more on the blog, there are 7 months to go.
This guide will walk you through adding Shine to your iOS application.
To begin using Shine you will need to acquire your unique application key. Currently these applications keys are given out on an ad-hoc basis by Soundwave. Please contact Soundwave if you have not received your key or would like to enquire about receiving a key.
Check out the example Shine app above for help getting started.
Shine SDK requires iOS 7.1+
Shine SDK can also be installed manually.
Add Other Linker Flag
To begin using Shine follow these steps:
AppDelegate class
#import <Shine/Shine.h>willFinishLaunchingWithOptions. At this point you will need to provide your unique application key which is available by contacting Soundwave.
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Shine setDeveloperKey:@"<Your-Dev-Key>"];
return YES;
}Once you have added this code, Shine will start capturing data once your app launches.
You can capture user registration data by adding the following code to your app:
...
//Create a new Shine user
SWUser *shineUser = SWUser.new;
shineUser.firstName = @"John";
shineUser.lastName = @"Smith";
shineUser.email = @"[email protected]";
//Register the user with Shine
[Shine registerUserDetails:shineUser];
...The following Shine integration points are not mandatory when using Shine.
Shine can capture a device's location if the host app has the required location services permissions. To capture location data, you need to add the following code to a class that conforms to the CLLocationDelegate protocol.
#import <Shine/Shine.h>
...
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
[Shine updateLocation:locations];
}Shine location tracking works for both kCLAuthorizationStatusAuthorizedAlways and kCLAuthorizationStatusAuthorizedWhenInUse. However, location data is only associated with song plays when the host app has kCLAuthorizationStatusAuthorizedAlways permission.
An example of capturing location data is available in the example app.
Shine can capture a device's contacts if the host app has the required contacts access permissions. Make a call to [Shine syncContacts] after permission to access contacts has been granted.
#import <Shine/Shine.h>
ABAddressBookRequestAccessWithCompletion(ABAddressBookCreateWithOptions(nil, nil), ^(bool granted, CFErrorRef error) {
if (granted) {
[Shine syncContacts];
}
});
An example of syncing contacts data is available in the example app.
Q. I don't think Shine is capturing any data
A. Turn on logging before you set your Developer Key. Shine logs will tell you if there are any problems capturing data.
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Shine enableLogging];
[Shine setDeveloperKey:@"<Your-Dev-Key>"];
return YES;
}Q. I get an error "Undefined symbols for architecture"
A. Make sure you have added -ObjC to your Other Linker Flags
Q. I get an error "Shine Authorization Failed: Please Enter A Valid Developer Key"
A. Make sure you have a valid Developer Key and have entered it correctly. Please contact Soundwave to obtain a Developer Key.