Skip to content

Commit

Permalink
Merge branch 'radarlabs:master' into add-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jt274 authored Aug 19, 2024
2 parents 0d87aab + fbee695 commit aa4a5af
Show file tree
Hide file tree
Showing 18 changed files with 651 additions and 773 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 3.11.0

- Bump iOS version from 3.15.0 to 3.17.0
- Bump Android version from 3.15.0 to 3.17.0

# 3.10.0

- Bump iOS version from 3.9.14 to 3.15.0
- Bump Android version from 3.9.8 to 3.15.0

# 3.9.1

- Bump iOS version from 3.9.7 to 3.9.14
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
}

dependencies {
implementation 'io.radar:sdk:3.9.8'
implementation 'io.radar:sdk:3.17.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.code.gson:gson:2.8.6'
}
667 changes: 271 additions & 396 deletions android/src/main/java/io/radar/flutter/RadarFlutterPlugin.java

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.radar.example"
minSdkVersion 16
minSdkVersion flutter.minSdkVersion
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation 'io.radar:sdk:3.9.8'
implementation 'io.radar:sdk:3.17.0'
implementation "com.google.android.play:integrity:1.2.0"
}
}
Expand Down
3 changes: 3 additions & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

</manifest>
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
3 changes: 2 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -29,6 +29,7 @@ flutter_ios_podfile_setup

target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'RadarSDKMotion', '3.17.0'
end

post_install do |installer|
Expand Down
31 changes: 26 additions & 5 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -149,6 +149,7 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
717FBB0054865DEA34CA9827 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -165,7 +166,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -208,10 +209,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -220,6 +223,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
};
717FBB0054865DEA34CA9827 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
8AED107CD2EAE06C6755A899 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -244,6 +264,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -347,7 +368,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = U6493D9J45;
DEVELOPMENT_TEAM = 96GHH65B9D;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -480,7 +501,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = U6493D9J45;
DEVELOPMENT_TEAM = 96GHH65B9D;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -508,7 +529,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = U6493D9J45;
DEVELOPMENT_TEAM = 96GHH65B9D;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 7 additions & 3 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Your iOS 11 and higher background location usage description goes here. e.g., "This app uses your location in the background to recommend places nearby."</string>
<string>Your iOS 11 and higher background location usage description goes here. e.g., &quot;This app uses your location in the background to recommend places nearby.&quot;</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Your iOS 10 and lower background location usage description goes here. e.g., "This app uses your location in the background to recommend places nearby."</string>
<string>Your iOS 10 and lower background location usage description goes here. e.g., &quot;This app uses your location in the background to recommend places nearby.&quot;</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your foreground location usage description goes here. e.g., "This app uses your location in the foreground to recommend places nearby."</string>
<string>Your foreground location usage description goes here. e.g., &quot;This app uses your location in the foreground to recommend places nearby.&quot;</string>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
Expand Down Expand Up @@ -78,5 +78,9 @@
</dict>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>NSMotionUsageDescription</key>
<string>Your motion usage description goes here. e.g., &quot;This app uses your motion to enable features.&quot;</string>
</dict>
</plist>
78 changes: 63 additions & 15 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_radar/flutter_radar.dart';
import 'package:permission_handler/permission_handler.dart';

void main() => runApp(MyApp());

Expand Down Expand Up @@ -75,8 +76,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
Radar.setLogLevel('info');
Radar.setAnonymousTrackingEnabled(false);

Radar.attachListeners();

Radar.onLocation(onLocation);
Radar.onClientLocation(onClientLocation);
Radar.onError(onError);
Expand All @@ -85,7 +84,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
Radar.onToken(onToken);

await Radar.requestPermissions(false);

await Radar.requestPermissions(true);
var permissionStatus = await Radar.getPermissionsStatus();
if (permissionStatus != "DENIED") {
Expand Down Expand Up @@ -126,6 +125,19 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
},
child: Text('requestPermissions()'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
PermissionStatus status =
await Permission.activityRecognition.request();
if (status.isGranted) {
print('Permission granted');
} else {
print('Permission denied');
}
},
child: Text('request activity permissions'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
Expand Down Expand Up @@ -249,7 +261,43 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
);
print("searchPlaces: $resp");
},
child: Text('searchPlaces'),
child: Text('searchPlaces()'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
var resp = await Radar.searchGeofences(
near: {
'latitude': 40.783826,
'longitude': -73.975363,
},
radius: 1000,
limit: 10,
includeGeometry: true,
tags: List.empty(),
metadata: {},
);
print("searchGeofences: $resp");
},
child: Text('searchGeofences()'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
var resp = await Radar.geocode(
'20 jay st brooklyn',
);
print("geocode: $resp");
},
child: Text('geocode()'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
var resp = await Radar.reverseGeocode();
print("reverseGeocode: $resp");
},
child: Text('reverseGeocode()'),
),
ElevatedButton(
style: raisedButtonStyle,
Expand Down Expand Up @@ -339,9 +387,16 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
ElevatedButton(
style: raisedButtonStyle,
onPressed: () {
Radar.startTrackingVerified(token: true);
Radar.startTrackingVerified(30, false);
},
child: Text('startTrackingVerified()'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () {
Radar.stopTrackingVerified();
},
child: Text('startTrackingVerified(token: true)'),
child: Text('stopTrackingVerified()'),
),
ElevatedButton(
style: raisedButtonStyle,
Expand Down Expand Up @@ -376,16 +431,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
Map? resp = await Radar.trackVerified();
print("trackVerified: $resp");
},
child: Text('trackVerified'),
),
ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
Map? resp = await Radar.trackVerifiedToken();
print("trackVerifiedToken: $resp");
},
child: Text('trackVerifiedToken'),
child: Text('trackVerified()'),
),

ElevatedButton(
style: raisedButtonStyle,
onPressed: () async {
Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.5
permission_handler: ^10.2.0

dev_dependencies:
flutter_test:
Expand Down
Loading

0 comments on commit aa4a5af

Please sign in to comment.