Skip to content

Commit

Permalink
Release v4.2.0 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel authored May 23, 2018
1 parent cfa60ad commit bd15cb4
Show file tree
Hide file tree
Showing 37 changed files with 349 additions and 82 deletions.
Binary file modified Placed.bundle/Info.plist
Binary file not shown.
Binary file removed Placed.bundle/PlacedOptInViewController.nib
Binary file not shown.
Binary file modified Placed.bundle/PlacedSurveyViewController.nib
Binary file not shown.
5 changes: 1 addition & 4 deletions Placed.bundle/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"project": "Placed-SDK-iOS",
"framework": "Placed",
"version": "4.1.1",
"version": "4.2.0",
"workspace": "Placed.xcworkspace",
"documentation_path": "README.md",
"documentation_image": "image_0.png",
"wkl": "s3://placed-api/placed-sdk/ios",
"configurations": {
"debug": {
"scheme": "PlacedFramework",
Expand Down
Binary file modified Placed.bundle/userDefaults-staging.plist
Binary file not shown.
Binary file modified Placed.bundle/userDefaults.plist
Binary file not shown.
25 changes: 11 additions & 14 deletions Placed.framework/Headers/PlacedAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@interface PlacedAgent : NSObject

/** This method initializes the PlacedAgent and sets the delegate to be notified of updates.
After calling registerUser this method will also handle starting location tracking in the agent.
You should call this in your application:didFinishLaunchingWithOptions: method.
Expand All @@ -22,31 +23,27 @@
*/
+ (void)createWithAppKey:(NSString *)appKey andDelegate:(id<PlacedAgentDelegate>)delegate;

/** This method starts location tracking in the agent.
Call this when you want location gathering to begin, but after initializing the agent.
*/
+ (void)startTracking;

/** This method stops all location tracking for the agent.
Only call this if you want all tracking to stop.
*/
+ (void)stopTracking;

/** This method allows you to change the delegate that is notified by the agent.
@param delegate the delegate you would like to be notified.
*/
+ (void)setAgentDelegate:(id<PlacedAgentDelegate>)delegate;

/** This will register a new user and call startTracking.
/** This will register a new user and start location tracking in the agent.
This method should only be called once, when a new user enters the app.
*/
+ (void)registerUser;

/** This will return if a user has been registered with a previous call to registerUser
/** This deregisters a user and stops all location tracking.
Only call this if you want all tracking to stop. The Placed SDK can only be restarted by calling registerUser again.
*/
+ (void)deregisterUser;

/** This will return if a user is in the registered state.
This will return true after calling registerUser and false after calling deregisterUser.
*/
+ (BOOL)isUserRegistered;

Expand Down
Binary file modified Placed.framework/Info.plist
Binary file not shown.
Binary file modified Placed.framework/Placed
Binary file not shown.
Binary file modified Placed.framework/Placed.bundle/Info.plist
Binary file not shown.
Binary file not shown.
Binary file modified Placed.framework/Placed.bundle/PlacedSurveyViewController.nib
Binary file not shown.
5 changes: 1 addition & 4 deletions Placed.framework/Placed.bundle/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"project": "Placed-SDK-iOS",
"framework": "Placed",
"version": "4.1.1",
"version": "4.2.0",
"workspace": "Placed.xcworkspace",
"documentation_path": "README.md",
"documentation_image": "image_0.png",
"wkl": "s3://placed-api/placed-sdk/ios",
"configurations": {
"debug": {
"scheme": "PlacedFramework",
Expand Down
Binary file modified Placed.framework/Placed.bundle/userDefaults-staging.plist
Binary file not shown.
Binary file modified Placed.framework/Placed.bundle/userDefaults.plist
Binary file not shown.
3 changes: 2 additions & 1 deletion Placed.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Placed"
s.version = "4.1.1"
s.version = "4.2.0"
s.summary = "Placed Affiliate SDK"
s.homepage = "https://www.placed.com"
s.author = { "Placed Affiliate Program" => "[email protected]" }
Expand All @@ -13,4 +13,5 @@ Pod::Spec.new do |s|
s.preserve_paths = 'Placed.framework'

s.frameworks = 'CoreData', 'CoreTelephony', 'CoreLocation', 'CoreMotion', 'SystemConfiguration', 'AdSupport', 'Foundation', 'UIKit', 'Security'
s.dependency 'CocoaLumberjack'
end
63 changes: 47 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,77 @@

## Introduction

The Placed SDK for iOS is designed to help you add Placed location gathering to your app. It exposes simple public API calls that can be used to turn location gathering on.
The Placed SDK for iOS is designed to help you add Placed location gathering to your app. It exposes simple public API calls that can be used to turn on and off location gathering.

The SDK has been designed for easy setup and integration with both new and existing mobile applications.

## Setup

The preferred method for installing the Placed SDK in your app is using CocoaPods. CocoaPods is dependency management system for Objective-C development. You can learn more about it at [http://cocoapods.org/](http://cocoapods.org/).
#### Cocoapods
The preferred method for installing the Placed SDK in your app is [CocoaPods](https://cocoapods.org/), a dependency manager for Cocoa projects. You can install CocoaPods with the following command:
```
$ gem install cocoapods
```

1. Add the following lines to your project's Podfile
`pod 'Placed', :git => 'https://github.com/placed/ios-placed-sdk.git'`
To integrate the Placed SDK into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
use_frameworks!

2. Celebrate!
pod 'Placed', :git => 'https://github.com/placed/ios-placed-sdk.git'
```
Then, run the following command:
```
$ pod install
```

If you are not using CocoaPods, you can integrate the Placed.framework and Placed.bundle directly in your project.
#### Manually

If you are not using CocoaPods, you can integrate [Placed.framework](./Placed.framework) manually into your project.

## Location Permission

This SDK requires Apple's background location permission. Under the "Required background modes" key in your app’s main plist file you should make sure to add:
As outlined in Section 5 of the [Placed Affiliate Agreement](https://affiliate.placed.com/placed-affiliate-agreement/), you must satisfy two requirements prior to registering a user with the Placed SDK:

App registers for location updates
1. *Gather Express Consent for User Data Collection via Opt-in Dialog*
In addition having a legally compliant privacy policy describing Placed’s collection of location and device information, you must include a discrete opt-in dialog which gathers express consent for data collection. This dialog appears prior to the fine location permission prompt, and includes:
- The language: “*Aggregated device data, including location, is measured for the purposes of market research by Placed, Inc.*
- Links to the Placed [Terms of Service](https://www.placed.com/terms-of-service) and [Privacy Policy](https://www.placed.com/privacy-policy)
- Buttons to “Accept” or “Cancel”

In addition, for iOS 11, you must provide all of the following location usage descriptions in your app's plist:

2. *Prompt for Background Location Permission*
Under the “Required background modes” `UIBackgroundModes` key in your app’s main plist file, you will need to add:
```
App registers for location updates
```
In addition, you must provide all of the following location usage descriptions in your app's plist:
```
NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
NSLocationUsageDescription
```
**These permissions are very important to the Placed SDK.** If your app does not currently use background location permission, please contact a Placed representative.
For an example of the opt-in dialog and location permission prompt, please refer to the sample app. We have also provided a [gallery for inspiration](./gallery) on how you can better integrate the opt-in experience into your app.
**These permissions are very important to the Placed SDK. If your app does not currently use background location permission, please contact a Placed representative.**
## Integration
## Usage
1. Add `#import <Placed/PlacedAgent.h>` to your main AppDelegate.
1. Add `[PlacedAgent createWithAppKey:andDelegate:]` call to your `AppDelegate`. Optionally, you may provide a `PlacedAgentDelegate` to this method but it is not required.
```objc
#import <Placed/PlacedAgent.h>
2. Initialize the agent in your AppDelegate's `application:didFinishLaunchingWithOptions:`.
@implementation AppDelegate
- Call `[PlacedAgent createWithAppKey:@"<Application Key>" andDelegate:nil];` providing the app key you received from Placed. Optionally, you may provide a `PlacedAgentDelegate` to this method but it is not required.
- Next, call `[PlacedAgent startTracking]`. This method must be called on every app start, but will only begin location collection if the user has been registered via the `[PlacedAgent registerUser]` method (see below).
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize Placed SDK
[PlacedAgent createWithAppKey:@"<Application Key>" andDelegate:nil]
}
```
3. Call `[PlacedAgent registerUser]` to register a new user for location collection by the Placed SDK. This method should only be called once in the user's lifecycle. If you have EULA or terms of service that the user is required to accept before tracking, call this method after the user accepts those terms. You may find the method `[PlacedAgent isUserRegistered]` useful for checking if `registerUser` has already been called before.
2. Once you've gathered express consent to collect user data, call `[PlacedAgent registerUser]` to register a new user for location collection by the Placed SDK. This method should only be called once in the user's lifecycle. You may find the method `[PlacedAgent isUserRegistered]` useful for checking if `registerUser` has already been called.
## How to join
Please contact your Placed representative to find out how to register your account. If you do not have a representative yet, please email [[email protected]](mailto:[email protected]).
Expand Down
1 change: 1 addition & 0 deletions SampleApp/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
platform :ios, '11.0'
use_frameworks!

target 'SampleApp' do
pod 'Placed', :git => 'https://github.com/placed/ios-placed-sdk.git'
Expand Down
24 changes: 0 additions & 24 deletions SampleApp/Podfile.lock

This file was deleted.

43 changes: 28 additions & 15 deletions SampleApp/SampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@
objects = {

/* Begin PBXBuildFile section */
2BF7B92520A3AFE800EE4D52 /* SampleAlertViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BF7B92320A3AFE800EE4D52 /* SampleAlertViewController.m */; };
2BF7B92620A3AFE800EE4D52 /* SampleAlertViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2BF7B92420A3AFE800EE4D52 /* SampleAlertViewController.xib */; };
96301AE7900C9797E86D11D0 /* Pods_SampleApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC4C4B2E15741F8E2E1B30E4 /* Pods_SampleApp.framework */; };
9B591B5A1FD6033B007630C9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B591B591FD6033B007630C9 /* AppDelegate.m */; };
9B591B5D1FD6033B007630C9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B591B5C1FD6033B007630C9 /* ViewController.m */; };
9B591B601FD6033B007630C9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B591B5E1FD6033B007630C9 /* Main.storyboard */; };
9B591B621FD6033B007630C9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9B591B611FD6033B007630C9 /* Assets.xcassets */; };
9B591B651FD6033B007630C9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B591B631FD6033B007630C9 /* LaunchScreen.storyboard */; };
9B591B681FD6033B007630C9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B591B671FD6033B007630C9 /* main.m */; };
E364D8FC89AD27A7D922DED3 /* libPods-SampleApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EE26D6FFA64FBE040560513 /* libPods-SampleApp.a */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
179D363020295416E0308F7D /* Pods-SampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp.debug.xcconfig"; sourceTree = "<group>"; };
1F70B84BCD5EF859658160BE /* Pods-SampleApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp.release.xcconfig"; sourceTree = "<group>"; };
2EE26D6FFA64FBE040560513 /* libPods-SampleApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SampleApp.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2BF7B92220A3AFE800EE4D52 /* SampleAlertViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SampleAlertViewController.h; sourceTree = "<group>"; };
2BF7B92320A3AFE800EE4D52 /* SampleAlertViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SampleAlertViewController.m; sourceTree = "<group>"; };
2BF7B92420A3AFE800EE4D52 /* SampleAlertViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SampleAlertViewController.xib; sourceTree = "<group>"; };
9B591B551FD6033B007630C9 /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
9B591B581FD6033B007630C9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
9B591B591FD6033B007630C9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
Expand All @@ -30,14 +34,15 @@
9B591B641FD6033B007630C9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9B591B661FD6033B007630C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9B591B671FD6033B007630C9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
FC4C4B2E15741F8E2E1B30E4 /* Pods_SampleApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
9B591B521FD6033B007630C9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E364D8FC89AD27A7D922DED3 /* libPods-SampleApp.a in Frameworks */,
96301AE7900C9797E86D11D0 /* Pods_SampleApp.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -56,7 +61,7 @@
4C453A66CFBDB94C9D986AFD /* Frameworks */ = {
isa = PBXGroup;
children = (
2EE26D6FFA64FBE040560513 /* libPods-SampleApp.a */,
FC4C4B2E15741F8E2E1B30E4 /* Pods_SampleApp.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -84,6 +89,9 @@
children = (
9B591B581FD6033B007630C9 /* AppDelegate.h */,
9B591B591FD6033B007630C9 /* AppDelegate.m */,
2BF7B92220A3AFE800EE4D52 /* SampleAlertViewController.h */,
2BF7B92320A3AFE800EE4D52 /* SampleAlertViewController.m */,
2BF7B92420A3AFE800EE4D52 /* SampleAlertViewController.xib */,
9B591B5B1FD6033B007630C9 /* ViewController.h */,
9B591B5C1FD6033B007630C9 /* ViewController.m */,
9B591B5E1FD6033B007630C9 /* Main.storyboard */,
Expand All @@ -106,8 +114,8 @@
9B591B511FD6033B007630C9 /* Sources */,
9B591B521FD6033B007630C9 /* Frameworks */,
9B591B531FD6033B007630C9 /* Resources */,
F46F2528666BE2DE16647CE7 /* [CP] Embed Pods Frameworks */,
3063A9684DA9F523F30ADF2E /* [CP] Copy Pods Resources */,
72228D0CE512AE3269B38989 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -164,6 +172,7 @@
9B591B651FD6033B007630C9 /* LaunchScreen.storyboard in Resources */,
9B591B621FD6033B007630C9 /* Assets.xcassets in Resources */,
9B591B601FD6033B007630C9 /* Main.storyboard in Resources */,
2BF7B92620A3AFE800EE4D52 /* SampleAlertViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -181,44 +190,47 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Placed.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp-resources.sh\"\n";
showEnvVarsInLog = 0;
};
E69845DF5A0241E1F0F3544B /* [CP] Check Pods Manifest.lock */ = {
72228D0CE512AE3269B38989 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
"${SRCROOT}/Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp-frameworks.sh",
"${PODS_ROOT}/Placed/Placed.framework",
);
name = "[CP] Check Pods Manifest.lock";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SampleApp-checkManifestLockResult.txt",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Placed.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F46F2528666BE2DE16647CE7 /* [CP] Embed Pods Frameworks */ = {
E69845DF5A0241E1F0F3544B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Embed Pods Frameworks";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SampleApp-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp-frameworks.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand All @@ -231,6 +243,7 @@
9B591B5D1FD6033B007630C9 /* ViewController.m in Sources */,
9B591B681FD6033B007630C9 /* main.m in Sources */,
9B591B5A1FD6033B007630C9 /* AppDelegate.m in Sources */,
2BF7B92520A3AFE800EE4D52 /* SampleAlertViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
1 change: 0 additions & 1 deletion SampleApp/SampleApp/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// Initialize Placed SDK
// IMPORTANT: This is where you'll want to enter your app key.
[PlacedAgent createWithAppKey:@"<Your Application Key>" andDelegate:nil];
[PlacedAgent startTracking];

return YES;
}
Expand Down
6 changes: 6 additions & 0 deletions SampleApp/SampleApp/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading

0 comments on commit bd15cb4

Please sign in to comment.