### Start a Trip Source: https://docs.radar.com/sdk/maui Initiates a trip to a specified destination with optional geofence and route mode configurations. This is often followed by starting background tracking. ```csharp RadarTripOptions tripOptions = new() { ExternalId = "299", DestinationGeofenceTag = "store", DestinationGeofenceExternalId = "123", Mode = RadarRouteMode.Car }; await Radar.StartTrip(tripOptions); Radar.StartTracking(Radar.TrackingOptionsContinuous); ``` -------------------------------- ### Start Background Tracking with Custom Options Source: https://docs.radar.com/sdk/maui Starts background location tracking with custom configuration. Allows fine-tuning update intervals, accuracy, stop duration, and more. Ensures location updates meet specific application needs. ```csharp RadarTrackingOptions trackingOptions = Radar.TrackingOptionsContinuous; trackingOptions.DesiredStoppedUpdateInterval = 180; trackingOptions.DesiredStoppedUpdateInterval = 60; trackingOptions.DesiredSyncInterval = 50; trackingOptions.DesiredAccuracy = RadarTrackingOptionsDesiredAccuracy.High; trackingOptions.StopDuration = 140; trackingOptions.StopDistance = 70; trackingOptions.Sync = RadarTrackingOptionsSync.All; trackingOptions.Replay = RadarTrackingOptionsReplay.None; Radar.StartTracking(trackingOptions); ``` -------------------------------- ### Start Trip Tracking Source: https://docs.radar.com/sdk/maui Initiates a trip to a specified destination with custom options, such as external IDs and geofence tags, and then starts background tracking. ```APIDOC ## Start Trip Tracking ### Description Starts a trip to a destination and simultaneously begins background location tracking. This is useful for scenarios like delivery tracking where a specific journey needs to be monitored. ### Method `await Radar.StartTrip(tripOptions)` followed by `Radar.StartTracking()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tripOptions** (RadarTripOptions) - Options for the trip, including `ExternalId`, `DestinationGeofenceTag`, `DestinationGeofenceExternalId`, and `Mode`. ### Request Example ```csharp RadarTripOptions tripOptions = new() { ExternalId = "299", DestinationGeofenceTag = "store", DestinationGeofenceExternalId = "123", Mode = RadarRouteMode.Car }; await Radar.StartTrip(tripOptions); Radar.StartTracking(Radar.TrackingOptionsContinuous); ``` ### Response None #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Install Radar SDK using Gradle (Android) Source: https://docs.radar.com/sdk/android Adds the Radar SDK to an Android project's dependencies using Gradle. This is the recommended installation method. It ensures the latest version of the SDK is included automatically. Ensure your project is configured with Maven Central for dependency resolution. ```gradle dependencies { implementation 'io.radar:sdk:3.21.+' } ``` -------------------------------- ### Install Flutter Radar Package Source: https://docs.radar.com/sdk/flutter Add the flutter_radar package to your pubspec.yaml file and run 'flutter pub get' to install it. This is the first step in integrating the Radar SDK into your Flutter application. ```yaml dependencies: flutter_radar: ^3.12.4 ``` ```bash flutter pub get ``` -------------------------------- ### Install MAUI Radar SDK Package Source: https://docs.radar.com/sdk/maui Installs the RadarIO.Xamarin package from NuGet, which supports both Xamarin and MAUI. This package should be added to each relevant project (iOS and Android). ```bash Install-Package RadarIO.Xamarin ``` -------------------------------- ### Start Background Tracking with Presets Source: https://docs.radar.com/sdk/maui Initiates background location tracking using predefined efficiency presets. Supports Efficient, Responsive, and Continuous tracking modes. These settings are persisted across app sessions. ```csharp Radar.StartTracking(Radar.TrackingOptionsEfficient); Radar.StartTracking(Radar.TrackingOptionsResponsive); Radar.StartTracking(Radar.TrackingOptionsContinuous); ``` -------------------------------- ### Install Radar SDK with Carthage Source: https://docs.radar.com/sdk/ios Add the Radar SDK to your project using Carthage. Include the Radar SDK in your `Cartfile`, run `carthage update`, and then link the `RadarSDK.framework` to your target. Avoid adding it to the `copy-frameworks` run script. ```ruby github "radarlabs/radar-sdk-ios" ~> 3.21.5 ``` -------------------------------- ### Initialize Radar SDK in iOS App (Swift) Source: https://docs.radar.com/sdk/ios Initialize the Radar SDK when your application starts using your publishable API key. This Swift code snippet demonstrates the initialization within the `didFinishLaunchingWithOptions` method of your AppDelegate. ```swift import UIKit import RadarSDK @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Radar.initialize(publishableKey: "prj_test_pk_...") return true } } ``` -------------------------------- ### Install Radar SDK with CocoaPods Source: https://docs.radar.com/sdk/ios Add the Radar SDK to your iOS project using CocoaPods. Ensure you have CocoaPods installed and a `Podfile` in your project directory. After installation, open the `.xcworkspace` file in Xcode. ```ruby pod 'RadarSDK', '~> 3.21.5' ``` -------------------------------- ### Initialize Radar SDK in Android Application Source: https://docs.radar.com/sdk/android Initializes the Radar SDK within the Android Application class. This setup is crucial for the SDK's functionality and should be called in the `onCreate()` method. It requires a publishable API key. Use test keys for development and live keys for production. Never use secret API keys in client-side code. ```java import io.radar.sdk.Radar; public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Radar.initialize(this, "prj_test_pk_..."); } } ``` ```kotlin import io.radar.sdk.Radar class MyApplication : Application() { override fun onCreate() { super.onCreate() Radar.initialize(this, "prj_test_pk_...") } } ``` -------------------------------- ### Start Geofencing Tracking with RESPONSIVE Preset Source: https://docs.radar.com/sdk/android Initiates background location tracking for geofencing using the Radar SDK's RESPONSIVE preset. This preset optimizes battery by adjusting update frequency based on device movement. Ensure background location permissions are authorized before calling. ```java Radar.startTracking(RadarTrackingOptions.RESPONSIVE); ``` ```kotlin Radar.startTracking(RadarTrackingOptions.RESPONSIVE) ``` -------------------------------- ### Start Background Tracking with Responsive Preset (Swift, Objective-C, Java, Kotlin) Source: https://docs.radar.com/sdk/tracking Demonstrates how to initialize background tracking using the 'RESPONSIVE' preset and enable beacons across multiple programming languages. This configuration prioritizes responsiveness while managing battery consumption. It requires the Radar SDK to be integrated. ```swift let trackingOptions = RadarTrackingOptions.presetResponsive trackingOptions.beacons = true Radar.startTracking(trackingOptions: trackingOptions) ``` ```objc RadarTrackingOptions *trackingOptions = RadarTrackingOptions.presetResponsive; trackingOptions.beacons = YES; [Radar startTrackingWithOptions:trackingOptions]; ``` ```java RadarTrackingOptions trackingOptions = RadarTrackingOptions.RESPONSIVE; trackingOptions.beacons = true; Radar.startTracking(trackingOptions); ``` ```kotlin val trackingOptions = RadarTrackingOptions.RESPONSIVE trackingOptions.beacons = true Radar.startTracking(trackingOptions) ``` -------------------------------- ### Initialize MAUI Radar SDK Source: https://docs.radar.com/sdk/maui Initializes the Radar SDK by calling RadarSingleton.Initialize with an implementation of RadarSDKImpl and then Radar.Initialize with the publishable key. This should be done once during application startup. ```csharp using RadarIO; using static RadarIO.RadarSingleton; namespace MyProject { public class Example { void Example () { RadarSingleton.Initialize(new RadarSDKImpl()); Radar.Initialize(publishableKey); } } } ``` -------------------------------- ### Get Users in a Geofence using cURL Source: https://docs.radar.com/api Retrieves users currently located within a specified geofence. The geofence is identified by its tag and externalId. This example uses cURL to make a GET request. ```curl curl "https://api.radar.io/v1/geofences/venue/2/users" \ -H "Authorization: prj_live_sk_..." ``` -------------------------------- ### Get Current Location Source: https://docs.radar.com/sdk/maui Retrieves a single location update from the device without sending it to the Radar server. ```APIDOC ## Get Current Location ### Description Fetches a single location update from the device's location services. This update is processed locally and not sent to the Radar backend, making it useful for immediate, client-side use cases. ### Method `await Radar.GetLocation()` ### Parameters None ### Request Example ```csharp var (status, location, stopped) = await Radar.GetLocation(); ``` ### Response - **status** (string) - The status of the location retrieval (e.g., 'ok', 'error'). - **location** (RadarLocation) - The retrieved location data. - **stopped** (bool) - Indicates if the location update signifies that the user has stopped moving. #### Success Response (200) Refer to the general response fields above. #### Response Example ```json { "status": "ok", "location": { "latitude": 34.052235, "longitude": -118.243683, "accuracy": 10 }, "stopped": false } ``` ``` -------------------------------- ### Initialize Radar SDK Source: https://docs.radar.com/sdk/web Initialize the Radar SDK with your publishable API key. This step is mandatory and must be performed before calling any other SDK functions. An optional configuration object can be passed for further customization. ```javascript Radar.initialize('prj_live_pk_...'); ``` ```javascript Radar.initialize('prj_live_pk_...', { /* custom options here */}); ``` -------------------------------- ### GET /directions Source: https://docs.radar.com/api Retrieves turn-by-turn directions for a given route. This endpoint is useful for navigation applications that need to guide users step-by-step. ```APIDOC ## GET /directions ### Description Retrieves turn-by-turn directions for a given route. This endpoint is useful for navigation applications that need to guide users step-by-step. ### Method GET ### Endpoint /directions ### Parameters #### Query Parameters - **origin** (string) - Required - The starting point for the route (e.g., latitude,longitude). - **destination** (string) - Required - The ending point for the route (e.g., latitude,longitude). - **mode** (string) - Optional - The mode of transportation (e.g., 'car', 'walking', 'cycling'). Defaults to 'car'. ### Request Example ``` GET /directions?origin=40.748433,-73.896754&destination=40.771256,-73.876885&mode=car ``` ### Response #### Success Response (200) - **distance** (object) - The distance for a specific leg of the journey. - **value** (number) - The distance in meters. - **text** (string) - The distance in a human-readable format. - **duration** (object) - The duration for a specific leg of the journey. - **value** (number) - The duration in seconds. - **text** (string) - The duration in a human-readable format. - **start_location** (object) - The starting coordinates for a specific leg. - **latitude** (number) - Latitude of the start location. - **longitude** (number) - Longitude of the start location. - **end_location** (object) - The ending coordinates for a specific leg. - **latitude** (number) - Latitude of the end location. - **longitude** (number) - Longitude of the end location. - **bearing_before** (number) - The bearing before the maneuver. - **bearing_after** (number) - The bearing after the maneuver. - **instructions** (string) - Detailed turn-by-turn instructions. - **banner_instructions** (string) - Abbreviated instructions suitable for display banners. - **voice_instructions** (string) - Instructions optimized for voice output. - **geometry** (object) - Encodes the path of the route. - **polyline** (string) - An encoded polyline string representing the route geometry. - **mode** (string) - The mode of transportation for this leg. - **maneuver** (string) - The type of maneuver to be performed (e.g., 'right', 'left', 'ramp-left'). - **street_name** (string) - The name of the street for this leg. - **exit_name** (string) - The name of the exit, if applicable. #### Response Example ```json [ { "distance": { "value": 201.16834, "text": "0.3 min" }, "duration": { "value": 18.288, "text": "0.3 min" }, "start_location": { "latitude": 40.748433, "longitude": -73.896754 }, "end_location": { "latitude": 40.748477, "longitude": -73.896294 }, "bearing_before": 342, "bearing_after": 83, "instructions": "Turn right onto 37th Avenue. Then Turn left to take the Interstate 2 78 East ramp.", "banner_instructions": "Turn right onto 37th Avenue.", "voice_instructions": "Turn right onto 37th Avenue.", "geometry": { "polyline": "axavlAbrh}kCM}Cc@{Ke@}I" }, "mode": "car", "manuever": "right", "street_name": "37th Avenue" }, { "distance": { "value": 2388.45152, "text": "0.5 mi" }, "duration": { "value": 59.232, "text": "1 min" }, "start_location": { "latitude": 40.748477, "longitude": -73.896294 }, "end_location": { "latitude": 40.754551, "longitude": -73.898787 }, "bearing_before": 81, "bearing_after": 54, "instructions": "Turn left to take the Interstate 2 78 East ramp toward Brooklyn Queens Expressway, LaGuardia.", "banner_instructions": "Turn left to take the I 278 East ramp toward Brooklyn Queens Expressway/LaGuardia/Robert F. Kennedy Bridge.", "voice_instructions": "Turn left to take the I 278 East ramp toward Brooklyn Queens Expressway/LaGuardia/Robert F. Kennedy Bridge.", "geometry": { "polyline": "yzavlAjug}kCoAqC_AaBeAy@kAm@oBg@s@UiAQcA?g@Pk@@_AZaAXu@\qG~Cq^dRgHrDgHjDoI|D}G~CeGnCaDfA{DhAaE`AiEx@sNzFsHl@aVnAm_@nD}ShDaQ`EiQfIs~@vg@mc@|V}CfB" }, "mode": "car", "manuever": "ramp-left", "street_name": "I 278 East/Brooklyn-Queens Expressway" } ] ``` ``` -------------------------------- ### Install Radar Web SDK using npm Source: https://docs.radar.com/sdk/web Install the radar-sdk-js package and its dependency maplibre-gl from npm for use in a web application. This is the recommended approach for modern web development workflows using module bundlers like Webpack or Vite. ```bash npm install --save radar-sdk-js maplibre-gl ``` -------------------------------- ### Trip Started Event Mapping Source: https://docs.radar.com/integrations/iterable Details the mapping for the 'user.started_trip' Radar event to the 'radarTripStarted' Iterable event, including field descriptions and examples. ```APIDOC ## radarTripStarted ### Description This section details the mapping for the 'user.started_trip' Radar event to the 'radarTripStarted' Iterable event. It includes the corresponding fields, their types, and example values. ### Method POST ### Endpoint /iterable/webhook ### Parameters #### Request Body - **radarRegionDMAName** (string) - Optional - The DMA name of the region where the trip started. - **radarRegionPostalCode** (string) - Optional - The postal code of the region where the trip started. - **radarTripExternalId** (string) - Required - The external identifier for the trip. - **radarBeaconIds** (array[string]) - Optional - An array of beacon IDs associated with the trip. - **radarBeaconDescriptions** (array[string]) - Optional - Descriptions for the associated beacons. - **radarBeaconTags** (array[string]) - Optional - Tags for the associated beacons. - **radarBeaconExternalIds** (array[string]) - Optional - External IDs for the associated beacons. ### Request Example ```json { "radarRegionDMAName": "Baltimore", "radarRegionPostalCode": "21014", "radarTripExternalId": "299", "radarBeaconIds": ["5b2c0906f5874b001aecfd8f"], "radarBeaconDescriptions": ["Store #123 - Drive-Thru"], "radarBeaconTags": ["drive-thru"], "radarBeaconExternalIds": ["123"] } ``` ### Response #### Success Response (200) An acknowledgement of successful receipt of the event. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### GET /navigation/directions Source: https://docs.radar.com/api Retrieves detailed turn-by-turn directions for a given route. This endpoint is useful for applications that need to guide users through a route step-by-step. ```APIDOC ## GET /navigation/directions ### Description Retrieves detailed turn-by-turn directions for a given route. This endpoint is useful for applications that need to guide users through a route step-by-step. ### Method GET ### Endpoint /navigation/directions ### Parameters #### Query Parameters - **origin** (string) - Required - The starting point of the route (e.g., latitude,longitude). - **destination** (string) - Required - The ending point of the route (e.g., latitude,longitude). - **mode** (string) - Optional - The mode of transport (e.g., 'car', 'walking', 'cycling'). Defaults to 'car'. ### Request Example ```json { "query": "GET /navigation/directions?origin=40.7128,-74.0060&destination=40.7580,-73.9855&mode=car" } ``` ### Response #### Success Response (200) - **voice_instructions** (string) - The spoken instruction for the maneuver. - **geometry** (object) - Contains the polyline encoding of the route segment. - **polyline** (string) - The encoded polyline string. - **mode** (string) - The mode of transport for this segment. - **maneuver** (string) - The type of maneuver (e.g., 'exit-right', 'left', 'right'). - **street_name** (string) - The name of the street for this segment. - **exit_name** (string) - The name of the exit if applicable. - **distance** (object) - The distance for this segment. - **value** (number) - The distance value in meters. - **text** (string) - The human-readable distance (e.g., '0.3 mi'). - **duration** (object) - The duration for this segment. - **value** (number) - The duration value in seconds. - **text** (string) - The human-readable duration (e.g., '2 mins'). - **start_location** (object) - The starting coordinates of the segment. - **latitude** (number) - Latitude. - **longitude** (number) - Longitude. - **end_location** (object) - The ending coordinates of the segment. - **latitude** (number) - Latitude. - **longitude** (number) - Longitude. - **bearing_before** (number) - The bearing before the maneuver. - **bearing_after** (number) - The bearing after the maneuver. - **instructions** (string) - Textual instruction for the maneuver. - **banner_instructions** (string) - Instruction text to be displayed on a banner. #### Response Example ```json [ { "voice_instructions": "Take exit 39 onto 65th Place.", "geometry": { "polyline": "genulAxut}kCwEo_@yEcZgAeF{AwFuAmEqAyDsPad@iC{GuHwRiCyLsFsP[_Cq@kF" }, "mode": "car", "manuever": "exit-right", "street_name": "Laurel Hill Boulevard", "exit_name": "39" }, { "distance": { "value": 1459.9738, "text": "0.3 mi" }, "duration": { "value": 1.9234166666666668, "text": "2 mins" }, "start_location": { "latitude": 40.739523, "longitude": -73.899832 }, "end_location": { "latitude": 40.743487, "longitude": -73.899074 }, "bearing_before": 74, "bearing_after": 5, "instructions": "Turn left onto 65th Place.", "banner_instructions": "Turn left onto 65th Place.", "voice_instructions": "Turn left onto 65th Place.", "geometry": { "polyline": "ekpulAnrn}kCwCQySeBiU{B_DSmHw@kHu@{BW{Ek@sEk@oDe@mEk@}BW{AQwJiAcq@{HoYkD{m@uHuCa@" }, "mode": "car", "manuever": "left", "street_name": "65th Place" } ] ``` ### Error Handling - **400 Bad Request**: If required parameters are missing or invalid. - **500 Internal Server Error**: If there is a server-side issue. ``` -------------------------------- ### Initialize Radar SDK in MainActivity (Java) Source: https://docs.radar.com/sdk/capacitor Initialize the Radar SDK within your `MainActivity.java` file by calling `Radar.initialize()`. This should be done in the `onCreate()` method, passing the application context and your Radar publishable API key. For Capacitor v4 and higher, ensure this call precedes `super.onCreate(savedInstanceState)`. ```java import android.os.Bundle; import com.getcapacitor.BridgeActivity; import io.radar.sdk.Radar; public class MainActivity extends BridgeActivity { @Override public void onCreate(Bundle savedInstanceState) { Radar.initialize(this, publishableKey); super.onCreate(savedInstanceState); } } ``` -------------------------------- ### Trip Tracking Source: https://docs.radar.com/sdk/ios Manage location tracking during user trips. This includes starting a trip with specific tracking options, completing it, or canceling it. ```APIDOC ## Start Trip Tracking ### Description Starts or updates a trip with specified options and tracking configuration. `RadarTrackingOptions.presetContinuous` is recommended for trip tracking, sending updates every 30 seconds. ### Method `Radar.startTrip` ### Endpoint N/A (Client-side SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **options** (TripOptions) - Required - Options for the trip. - **trackingOptions** (RadarTrackingOptions) - Required - The tracking configuration for the trip. Use `RadarTrackingOptions.presetContinuous`. - **completionHandler** (Callback Function) - Required - A callback function that receives the status, trip details, and events. ### Request Example ```swift Radar.startTrip(options: tripOptions, trackingOptions: .presetContinuous) { (status: RadarStatus, trip: RadarTrip?, events: [RadarEvent]?) in if status == .success { // do something } else { // handle error } } ``` ```objective-c [Radar startTripWithOptions:tripOptions trackingOptions:RadarTrackingOptions.presetContinuous completionHandler:^(RadarStatus status, RadarTrip * _Nullable trip, NSArray * _Nullable events) { if (status == RadarStatusSuccess) { // do something } else { // handle error } }]; ``` ### Response Callback with `RadarStatus`, `RadarTrip`, and `[RadarEvent]`. ## Complete Trip ### Description Marks the current trip as completed. ### Method `Radar.completeTrip` ### Endpoint N/A (Client-side SDK method) ### Parameters None ### Request Example ```swift Radar.completeTrip() ``` ```objective-c [Radar completeTrip]; ``` ### Response N/A (This is a method call, not an API request/response) ## Cancel Trip ### Description Cancels the current trip. ### Method `Radar.cancelTrip` ### Endpoint N/A (Client-side SDK method) ### Parameters None ### Request Example ```swift Radar.cancelTrip() ``` ```objective-c [Radar cancelTrip]; ``` ### Response N/A (This is a method call, not an API request/response) ``` -------------------------------- ### iOS SDK Initialization Source: https://docs.radar.com/sdk/capacitor Initialize the Radar SDK in your AppDelegate upon application launch. This Swift code snippet demonstrates how to import the necessary frameworks and call the `Radar.initialize` method with your Radar publishable API key. ```swift import Capacitor import RadarSDK @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Replace with your actual publishable API key let publishableKey = "YOUR_PUBLISHABLE_API_KEY" Radar.initialize(publishableKey: publishableKey) return true } } ``` -------------------------------- ### Get Context for a Location (C#) Source: https://docs.radar.com/sdk/maui Retrieves contextual information for a given location without sending device or user identifiers. It utilizes the Radar Context API. ```csharp var (status, location, context) = await Radar.GetContext(); ``` -------------------------------- ### Mock Tracking Source: https://docs.radar.com/sdk/maui Simulates a sequence of location updates for testing purposes, allowing you to define origins, destinations, routes, and update intervals. ```APIDOC ## Mock Tracking ### Description Simulates a sequence of location updates for testing the SDK's behavior without actual device movement. You can specify the origin, destination, travel mode, number of updates, and interval between updates. ### Method `Radar.MockTracking(origin, destination, mode, count, interval, callback)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp RadarLocation origin = new() { Latitude = 40.714708, Longitude = -74.035807 }; RadarLocation destination = new() { Latitude = 40.717410, Longitude = -74.053334 }; Radar.MockTracking(origin, destination, RadarRouteMode.Car, 10, 3, data => { System.Console.WriteLine($"Mock location: {data.Location.Latitude} {data.Location.Longitude}"); }); ``` ### Response None #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Start Trip Tracking with Continuous Mode (Java & Kotlin) Source: https://docs.radar.com/sdk/android Initiates background tracking for a trip using Radar SDK's continuous mode. This preset sends location updates every 30 seconds and starts a foreground service to comply with background location limits. It requires trip options and a callback for completion status. ```java Radar.startTrip(tripOptions, RadarTrackingOptions.CONTINUOUS, new Radar.RadarTripCallback() { @Override public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarTrip trip, @Nullable RadarEvent[] events) { if (status == Radar.RadarStatus.SUCCESS) { // do something } else { // handle error } } }); ``` ```kotlin Radar.startTrip(tripOptions, RadarTrackingOptions.CONTINUOUS) { status, trip, events -> if (status == Radar.RadarStatus.SUCCESS) { // do something } else { // handle error } } ``` -------------------------------- ### Install Radar Web SDK in HTML Source: https://docs.radar.com/sdk/web Include the Radar SDK stylesheet and script in an HTML page to use the SDK directly. This method is suitable for simple web pages or when not using a module bundler. ```html ``` -------------------------------- ### Prompt for Motion Permissions Source: https://docs.radar.com/sdk/android Code examples in Java and Kotlin demonstrating how to manually request activity recognition permissions from the user. This is a crucial step after adding the permissions to the manifest. ```java ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACTIVITY_RECOGNITION}, ACTIVITY_RECOGNITION_PERMISSION_CODE); ``` ```kotlin ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.ACTIVITY_RECOGNITION), ACTIVITY_RECOGNITION_PERMISSION_CODE) ``` -------------------------------- ### Initialize Radar SDK in iOS App (Objective-C) Source: https://docs.radar.com/sdk/ios Initialize the Radar SDK upon app launch using your publishable API key. This Objective-C code snippet shows the initialization within the `application:didFinishLaunchingWithOptions:` method of your AppDelegate. ```objectivec #import "AppDelegate.h" @import RadarSDK; @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [Radar initializeWithPublishableKey:@"prj_test_pk_..."]; return YES; } @end ``` -------------------------------- ### Get Current Location Without Server Update Source: https://docs.radar.com/sdk/maui Retrieves a single location update from the device without sending the data to the Radar servers. Useful for immediate local processing. ```csharp var (status, location, stopped) = await Radar.GetLocation(); ``` -------------------------------- ### Monitor Beacons in Background (Java & Kotlin) Source: https://docs.radar.com/sdk/android Configure Radar to monitor beacons in the background by updating tracking options. Set the 'beacons' property to true within RadarTrackingOptions and then start tracking. ```java RadarTrackingOptions trackingOptions = RadarTrackingOptions.RESPONSIVE; trackingOptions.beacons = true; Radar.startTracking(trackingOptions); ``` ```kotlin val trackingOptions = RadarTrackingOptions.RESPONSIVE trackingOptions.beacons = true Radar.startTracking(trackingOptions) ```