A collection of sample applications demonstrating how to use the Pathsense iOS SDK. For more information, take a look at the documentation or connect with us on our website or developer portal.
You can see the additional information for each sample in their respective README files.
- PSLocation Sample (Obj-C)
- PSLocation LowPower Sample (Obj-C)
- PSLocation Ambient Sample (Obj-C)
- WakeUp Sample (Obj-C)
- WakeUp Sample (Swift)
- TripsBasicSample (Swift)
-
Obtain a Pathsense SDK Client ID and API Key from here. Click “GET STARTED” and enter your email address.
-
Make sure you are using the latest version of Xcode (10.0+) and targeting iOS 9.0 or higher.
-
Add the PSLocation.framework to your Xcode project (This framework needs to be added to the Embedded Binaries as well).
- Under the Build Phases tab in your Target, click the + button on the top left and then select New Run Script Phase. Then setup the build phase as follows. Make sure this phase is below the Embed Frameworks phase:
-
In your AppDelegate add the following code to your application:didFinishLaunchingWithOptions:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [PSLocation setApiKey:@"your api key here" andClientID:@"your client ID"]; return YES; }
-
Make sure to include PSLocation framework headers in your AppDelegate.h file:
#import <PSLocation/PSLocation.h>
-
In your AppDelegate add the following code to your application(_:didFinishLaunchingWithOptions:)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { PSLocation.setApiKey("your api key here", andClientID: "your client ID") return true }
-
Make sure to include PSLocation framework in your AppDelegate file:
import PSLocation