100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Switched to native iOS app for generic app
Michael Rademaker4717681f5aa2
diff --git a/console/generic_app/android/app/build.gradle b/console/generic_app/android/app/build.gradleindex 7f3878575..938fa1953 100644--- a/console/generic_app/android/app/build.gradle+++ b/console/generic_app/android/app/build.gradle@@ -24,6 +24,7 @@ if (flutterVersionName == null) {apply plugin: 'com.android.application'apply plugin: 'kotlin-android'apply plugin: 'com.google.gms.google-services'+apply plugin: 'com.google.firebase.crashlytics'apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"def keystoreProperties = new Properties()@@ -74,6 +75,8 @@ flutter {dependencies {implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"implementation 'com.google.firebase:firebase-messaging:20.2.4'+ implementation 'com.google.firebase:firebase-crashlytics:17.2.2'+ implementation 'com.google.firebase:firebase-analytics:17.6.0'testImplementation 'junit:junit:4.12'androidTestImplementation 'androidx.test:runner:1.1.1'androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'diff --git a/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/Application.kt b/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/Application.ktindex c458f08dc..758c80a83 100644--- a/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/Application.kt+++ b/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/Application.kt@@ -9,6 +9,8 @@ import io.flutter.plugin.common.PluginRegistryimport io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallbackimport io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingServiceimport io.flutter.plugins.geofencing.GeofencingService+import io.flutter.embedding.engine.FlutterEngine+import io.flutter.plugins.GeneratedPluginRegistrantclass Application : FlutterApplication(), PluginRegistrantCallback {override fun onCreate() {@@ -35,6 +37,9 @@ class Application : FlutterApplication(), PluginRegistrantCallback {override fun registerWith(registry: PluginRegistry) {io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"))+ io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin"));registry?.registrarFor("io.flutter.plugins.geofencing.GeofencingPlugin")++ GeneratedPluginRegistrant.registerWith(FlutterEngine(this))}}diff --git a/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/MainActivity.kt b/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/MainActivity.ktindex 542af24e2..3a792eeee 100644--- a/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/MainActivity.kt+++ b/console/generic_app/android/app/src/main/kotlin/io/openremote/generic_app/MainActivity.kt@@ -1,6 +1,9 @@package io.openremote.generic_app+import androidx.annotation.NonNull;import io.flutter.embedding.android.FlutterActivity+import io.flutter.embedding.engine.FlutterEngine+import io.flutter.plugins.GeneratedPluginRegistrantclass MainActivity: FlutterActivity() {diff --git a/console/generic_app/android/build.gradle b/console/generic_app/android/build.gradleindex c60e855ee..42b3896ec 100644--- a/console/generic_app/android/build.gradle+++ b/console/generic_app/android/build.gradle@@ -9,6 +9,7 @@ buildscript {classpath 'com.android.tools.build:gradle:3.5.4'classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"classpath 'com.google.gms:google-services:4.3.3'+ classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'}}diff --git a/console/generic_app/android/key.properties b/console/generic_app/android/key.propertiesindex 4001f7874..2977a88a6 100644--- a/console/generic_app/android/key.properties+++ b/console/generic_app/android/key.properties@@ -1,4 +1,4 @@-storePassword=password-keyPassword=password-keyAlias=fill_in_alias-storeFile=path_of_jks+storePassword=sQzDcfOefncnFDQx+keyPassword=sQzDcfOefncnFDQx+keyAlias=or_demo+storeFile=/Users/michael/Documents/AppBriek/OpenRemote/Code/openremote/console/generic_app/android/or_demo.jksdiff --git a/console/generic_app/ios/Podfile b/console/generic_app/ios/Podfiledeleted file mode 100644index 10f3c9b47..000000000--- a/console/generic_app/ios/Podfile+++ /dev/null@@ -1,41 +0,0 @@-# Uncomment this line to define a global platform for your project-platform :ios, '13.0'--# CocoaPods analytics sends network stats synchronously affecting flutter build latency.-ENV['COCOAPODS_DISABLE_STATS'] = 'true'--project 'Runner', {- 'Debug' => :debug,- 'Profile' => :release,- 'Release' => :release,-}--def flutter_root- generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)- unless File.exist?(generated_xcode_build_settings_path)- raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"- end-- File.foreach(generated_xcode_build_settings_path) do |line|- matches = line.match(/FLUTTER_ROOT\=(.*)/)- return matches[1].strip if matches- end- raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"-end--require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)--flutter_ios_podfile_setup--target 'Runner' do- use_frameworks!- use_modular_headers!-- flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))-end--post_install do |installer|- installer.pods_project.targets.each do |target|- flutter_additional_ios_build_settings(target)- end-enddiff --git a/console/generic_app/ios/Podfile.lock b/console/generic_app/ios/Podfile.lockdeleted file mode 100644index 60dac9835..000000000--- a/console/generic_app/ios/Podfile.lock+++ /dev/null@@ -1,165 +0,0 @@-PODS:- - Firebase/CoreOnly (6.26.0):- - FirebaseCore (= 6.7.2)- - Firebase/Messaging (6.26.0):- - Firebase/CoreOnly- - FirebaseMessaging (~> 4.4.1)- - firebase_core (0.5.0):- - Firebase/CoreOnly (~> 6.26.0)- - Flutter- - firebase_messaging (7.0.0):- - Firebase/CoreOnly (~> 6.26.0)- - Firebase/Messaging (~> 6.26.0)- - firebase_core- - Flutter- - FirebaseAnalyticsInterop (1.5.0)- - FirebaseCore (6.7.2):- - FirebaseCoreDiagnostics (~> 1.3)- - FirebaseCoreDiagnosticsInterop (~> 1.2)- - GoogleUtilities/Environment (~> 6.5)- - GoogleUtilities/Logger (~> 6.5)- - FirebaseCoreDiagnostics (1.6.0):- - GoogleDataTransport (~> 7.2)- - GoogleUtilities/Environment (~> 6.7)- - GoogleUtilities/Logger (~> 6.7)- - nanopb (~> 1.30906.0)- - FirebaseCoreDiagnosticsInterop (1.2.0)- - FirebaseInstallations (1.3.0):- - FirebaseCore (~> 6.6)- - GoogleUtilities/Environment (~> 6.6)- - GoogleUtilities/UserDefaults (~> 6.6)- - PromisesObjC (~> 1.2)- - FirebaseInstanceID (4.3.4):- - FirebaseCore (~> 6.6)- - FirebaseInstallations (~> 1.0)- - GoogleUtilities/Environment (~> 6.5)- - GoogleUtilities/UserDefaults (~> 6.5)- - FirebaseMessaging (4.4.1):- - FirebaseAnalyticsInterop (~> 1.5)- - FirebaseCore (~> 6.6)- - FirebaseInstanceID (~> 4.3)- - GoogleUtilities/AppDelegateSwizzler (~> 6.5)- - GoogleUtilities/Environment (~> 6.5)- - GoogleUtilities/Reachability (~> 6.5)- - GoogleUtilities/UserDefaults (~> 6.5)- - Protobuf (>= 3.9.2, ~> 3.9)- - Flutter (1.0.0)- - geofencing (0.0.1):- - Flutter- - GoogleDataTransport (7.3.0):- - nanopb (~> 1.30906.0)- - GoogleUtilities/AppDelegateSwizzler (6.7.2):- - GoogleUtilities/Environment- - GoogleUtilities/Logger- - GoogleUtilities/Network- - GoogleUtilities/Environment (6.7.2):- - PromisesObjC (~> 1.2)- - GoogleUtilities/Logger (6.7.2):- - GoogleUtilities/Environment- - GoogleUtilities/Network (6.7.2):- - GoogleUtilities/Logger- - "GoogleUtilities/NSData+zlib"- - GoogleUtilities/Reachability- - "GoogleUtilities/NSData+zlib (6.7.2)"- - GoogleUtilities/Reachability (6.7.2):- - GoogleUtilities/Logger- - GoogleUtilities/UserDefaults (6.7.2):- - GoogleUtilities/Logger- - location (0.0.1):- - Flutter- - nanopb (1.30906.0):- - nanopb/decode (= 1.30906.0)- - nanopb/encode (= 1.30906.0)- - nanopb/decode (1.30906.0)- - nanopb/encode (1.30906.0)- - "permission_handler (5.0.1+1)":- - Flutter- - PromisesObjC (1.2.10)- - Protobuf (3.13.0)- - quick_actions (0.0.1):- - Flutter- - shared_preferences (0.0.1):- - Flutter- - url_launcher (0.0.1):- - Flutter- - webview_flutter (0.0.1):- - Flutter--DEPENDENCIES:- - firebase_core (from `.symlinks/plugins/firebase_core/ios`)- - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)- - Flutter (from `Flutter`)- - geofencing (from `.symlinks/plugins/geofencing/ios`)- - location (from `.symlinks/plugins/location/ios`)- - permission_handler (from `.symlinks/plugins/permission_handler/ios`)- - quick_actions (from `.symlinks/plugins/quick_actions/ios`)- - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)- - url_launcher (from `.symlinks/plugins/url_launcher/ios`)- - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)--SPEC REPOS:- trunk:- - Firebase- - FirebaseAnalyticsInterop- - FirebaseCore- - FirebaseCoreDiagnostics- - FirebaseCoreDiagnosticsInterop- - FirebaseInstallations- - FirebaseInstanceID- - FirebaseMessaging- - GoogleDataTransport- - GoogleUtilities- - nanopb- - PromisesObjC- - Protobuf--EXTERNAL SOURCES:- firebase_core:- :path: ".symlinks/plugins/firebase_core/ios"- firebase_messaging:- :path: ".symlinks/plugins/firebase_messaging/ios"- Flutter:- :path: Flutter- geofencing:- :path: ".symlinks/plugins/geofencing/ios"- location:- :path: ".symlinks/plugins/location/ios"- permission_handler:- :path: ".symlinks/plugins/permission_handler/ios"- quick_actions:- :path: ".symlinks/plugins/quick_actions/ios"- shared_preferences:- :path: ".symlinks/plugins/shared_preferences/ios"- url_launcher:- :path: ".symlinks/plugins/url_launcher/ios"- webview_flutter:- :path: ".symlinks/plugins/webview_flutter/ios"--SPEC CHECKSUMS:- Firebase: 7cf5f9c67f03cb3b606d1d6535286e1080e57eb6- firebase_core: 3134fe79d257d430f163b558caf52a10a87efe8a- firebase_messaging: 6061cbdfe4463502a0d4d7049820c25d1757a095- FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae- FirebaseCore: f42e5e5f382cdcf6b617ed737bf6c871a6947b17- FirebaseCoreDiagnostics: 7415bfb3883b3500c5a95c42b6ba66baae78f600- FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850- FirebaseInstallations: 6f5f680e65dc374397a483c32d1799ba822a395b- FirebaseInstanceID: cef67c4967c7cecb56ea65d8acbb4834825c587b- FirebaseMessaging: 29543feb343b09546ab3aa04d008ee8595b43c44- Flutter: 0e3d915762c693b495b44d77113d4970485de6ec- geofencing: 98674d4c10508e8bbf7678623d48c2a4172559ee- GoogleDataTransport: e85fb700c9b027079ce182c3d08e12e0f9618bb4- GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3- location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740- nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc- permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6- PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151- Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748- quick_actions: 6cb2390c4dab0e737c94573c27e18d9666710720- shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d- url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef- webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96--PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b--COCOAPODS: 1.9.1diff --git a/console/generic_app/ios/Runner.xcodeproj/project.pbxproj b/console/generic_app/ios/Runner.xcodeproj/project.pbxprojindex 54779b457..df4c779ff 100644--- a/console/generic_app/ios/Runner.xcodeproj/project.pbxproj+++ b/console/generic_app/ios/Runner.xcodeproj/project.pbxproj@@ -152,6 +152,7 @@9705A1C41CF9048500538489 /* Embed Frameworks */,3B06AD1E1E4923F5004D2608 /* Thin Binary */,EEC19896CF4CEF1F07DC6E5F /* [CP] Embed Pods Frameworks */,+ 4CFA0C4E253EEA4B0060C0EF /* Crashlytics */,);buildRules = ();@@ -226,6 +227,26 @@shellPath = /bin/sh;shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";};+ 4CFA0C4E253EEA4B0060C0EF /* Crashlytics */ = {+ isa = PBXShellScriptBuildPhase;+ buildActionMask = 2147483647;+ files = (+ );+ inputFileListPaths = (+ );+ inputPaths = (+ "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}",+ "$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)",+ );+ name = Crashlytics;+ outputFileListPaths = (+ );+ outputPaths = (+ );+ runOnlyForDeploymentPostprocessing = 0;+ shellPath = /bin/sh;+ shellScript = "${PODS_ROOT}/FirebaseCrashlytics/run\n\n";+ };9740EEB61CF901F6004384FC /* Run Script */ = {isa = PBXShellScriptBuildPhase;buildActionMask = 2147483647;@@ -391,7 +412,7 @@ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;CLANG_ENABLE_MODULES = YES;CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;- CURRENT_PROJECT_VERSION = 15;+ CURRENT_PROJECT_VERSION = 16;DEVELOPMENT_TEAM = 4AC88KZHJZ;ENABLE_BITCODE = NO;FRAMEWORK_SEARCH_PATHS = (@@ -404,6 +425,7 @@"$(inherited)","$(PROJECT_DIR)/Flutter",);+ MARKETING_VERSION = 1.0.2;PRODUCT_BUNDLE_IDENTIFIER = io.openremote.app;PRODUCT_NAME = OpenRemote;SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";@@ -526,7 +548,7 @@ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;CLANG_ENABLE_MODULES = YES;CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;- CURRENT_PROJECT_VERSION = 15;+ CURRENT_PROJECT_VERSION = 16;DEVELOPMENT_TEAM = 4AC88KZHJZ;ENABLE_BITCODE = NO;FRAMEWORK_SEARCH_PATHS = (@@ -539,6 +561,7 @@"$(inherited)","$(PROJECT_DIR)/Flutter",);+ MARKETING_VERSION = 1.0.2;PRODUCT_BUNDLE_IDENTIFIER = io.openremote.app;PRODUCT_NAME = OpenRemote;SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";@@ -556,7 +579,7 @@ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;CLANG_ENABLE_MODULES = YES;CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;- CURRENT_PROJECT_VERSION = 15;+ CURRENT_PROJECT_VERSION = 16;DEVELOPMENT_TEAM = 4AC88KZHJZ;ENABLE_BITCODE = NO;FRAMEWORK_SEARCH_PATHS = (@@ -569,6 +592,7 @@"$(inherited)","$(PROJECT_DIR)/Flutter",);+ MARKETING_VERSION = 1.0.2;PRODUCT_BUNDLE_IDENTIFIER = io.openremote.app;PRODUCT_NAME = OpenRemote;SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";diff --git a/console/generic_app/ios/Runner/Info.plist b/console/generic_app/ios/Runner/Info.plistindex f0c2481c2..c3be213ad 100644--- a/console/generic_app/ios/Runner/Info.plist+++ b/console/generic_app/ios/Runner/Info.plist@@ -17,15 +17,15 @@<key>CFBundlePackageType</key><string>APPL</string><key>CFBundleShortVersionString</key>- <string>$(FLUTTER_BUILD_NAME)</string>+ <string>$(MARKETING_VERSION)</string><key>CFBundleSignature</key><string>????</string><key>CFBundleVersion</key><string>$(CURRENT_PROJECT_VERSION)</string>- <key>LSRequiresIPhoneOS</key>- <true/><key>ITSAppUsesNonExemptEncryption</key><false/>+ <key>LSRequiresIPhoneOS</key>+ <true/><key>NSAppleMusicUsageDescription</key><string>Permission to Apple Music is needed in order to easly share information</string><key>NSCalendarsUsageDescription</key>diff --git a/console/generic_app/ios/Runner/mapstogpx20200923_085404.gpx b/console/generic_app/ios/Runner/mapstogpx20200923_085404.gpxnew file mode 100644index 000000000..e69de29bbdiff --git a/console/generic_app/lib/ConsoleProviders/geofence_provider.dart b/console/generic_app/lib/ConsoleProviders/geofence_provider.dartindex 8e20e10d1..5773df8d6 100644--- a/console/generic_app/lib/ConsoleProviders/geofence_provider.dart+++ b/console/generic_app/lib/ConsoleProviders/geofence_provider.dart@@ -192,18 +192,17 @@ class GeofenceProvider {GeofenceDefinition.fromJson).then((geofenceDefinitions) async {print("Fetched geofences=${geofenceDefinitions.length}");- final List<GeofenceDefinition> remainingGeofences = List.from(geofenceDefinitions);+ final List<GeofenceDefinition> remainingGeofences = [];geofences.forEach((oldGeofence) async {- if (!geofenceDefinitions- .any((definition) => definition.id == oldGeofence.id)) {+ if (!geofenceDefinitions.any((definition) => definition.id == oldGeofence.id)) {await removeGeofence(oldGeofence.id);} else {- remainingGeofences.removeWhere((element) => element.id == oldGeofence.id);+ remainingGeofences.add(oldGeofence);}});- remainingGeofences.forEach((definition) async {- if (!geofences.any((element) => element.id == definition.id)) {+ geofenceDefinitions.forEach((definition) async {+ if (!remainingGeofences.any((element) => element.id == definition.id)) {await addGeofence(definition);}});diff --git a/console/generic_app/lib/main.dart b/console/generic_app/lib/main.dartindex ba0a2bd30..a2bf9c367 100644--- a/console/generic_app/lib/main.dart+++ b/console/generic_app/lib/main.dart@@ -1,3 +1,5 @@+import 'package:firebase_core/firebase_core.dart';+import 'package:firebase_crashlytics/firebase_crashlytics.dart';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:flutter_localizations/flutter_localizations.dart';@@ -9,11 +11,14 @@ void main() {WidgetsFlutterBinding.ensureInitialized();SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) async {+ await Firebase.initializeApp();+ FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;runApp(ORApp());});}class ORApp extends StatelessWidget {static final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();+// This widget is the root of your application.@overrideWidget build(BuildContext context) {diff --git a/console/generic_app/pubspec.lock b/console/generic_app/pubspec.lockindex 683206149..a4c1184b0 100644--- a/console/generic_app/pubspec.lock+++ b/console/generic_app/pubspec.lock@@ -35,7 +35,7 @@ packages:name: asyncurl: "https://pub.dartlang.org"source: hosted- version: "2.4.2"+ version: "2.5.0-nullsafety.1"awesome_dialog:dependency: "direct main"description:@@ -49,7 +49,7 @@ packages:name: boolean_selectorurl: "https://pub.dartlang.org"source: hosted- version: "2.0.0"+ version: "2.1.0-nullsafety.1"build:dependency: transitivedescription:@@ -112,14 +112,14 @@ packages:name: charactersurl: "https://pub.dartlang.org"source: hosted- version: "1.0.0"+ version: "1.1.0-nullsafety.3"charcode:dependency: transitivedescription:name: charcodeurl: "https://pub.dartlang.org"source: hosted- version: "1.1.3"+ version: "1.2.0-nullsafety.1"checked_yaml:dependency: transitivedescription:@@ -140,7 +140,7 @@ packages:name: clockurl: "https://pub.dartlang.org"source: hosted- version: "1.0.1"+ version: "1.1.0-nullsafety.1"code_builder:dependency: transitivedescription:@@ -154,7 +154,7 @@ packages:name: collectionurl: "https://pub.dartlang.org"source: hosted- version: "1.14.13"+ version: "1.15.0-nullsafety.3"convert:dependency: transitivedescription:@@ -203,7 +203,7 @@ packages:name: fake_asyncurl: "https://pub.dartlang.org"source: hosted- version: "1.1.0"+ version: "1.2.0-nullsafety.1"ffi:dependency: transitivedescription:@@ -226,12 +226,12 @@ packages:source: hostedversion: "7.3.0"firebase_core:- dependency: transitive+ dependency: "direct main"description:name: firebase_coreurl: "https://pub.dartlang.org"source: hosted- version: "0.5.0"+ version: "0.5.0+1"firebase_core_platform_interface:dependency: transitivedescription:@@ -246,6 +246,20 @@ packages:url: "https://pub.dartlang.org"source: hostedversion: "0.2.0"+ firebase_crashlytics:+ dependency: "direct main"+ description:+ name: firebase_crashlytics+ url: "https://pub.dartlang.org"+ source: hosted+ version: "0.2.1+1"+ firebase_crashlytics_platform_interface:+ dependency: transitive+ description:+ name: firebase_crashlytics_platform_interface+ url: "https://pub.dartlang.org"+ source: hosted+ version: "1.1.1"firebase_messaging:dependency: "direct main"description:@@ -440,14 +454,14 @@ packages:name: matcherurl: "https://pub.dartlang.org"source: hosted- version: "0.12.8"+ version: "0.12.10-nullsafety.1"meta:dependency: transitivedescription:name: metaurl: "https://pub.dartlang.org"source: hosted- version: "1.1.8"+ version: "1.3.0-nullsafety.3"mime:dependency: transitivedescription:@@ -482,7 +496,7 @@ packages:name: pathurl: "https://pub.dartlang.org"source: hosted- version: "1.7.0"+ version: "1.8.0-nullsafety.1"path_provider_linux:dependency: transitivedescription:@@ -711,21 +725,21 @@ packages:name: source_spanurl: "https://pub.dartlang.org"source: hosted- version: "1.7.0"+ version: "1.8.0-nullsafety.2"stack_trace:dependency: transitivedescription:name: stack_traceurl: "https://pub.dartlang.org"source: hosted- version: "1.9.5"+ version: "1.10.0-nullsafety.1"stream_channel:dependency: transitivedescription:name: stream_channelurl: "https://pub.dartlang.org"source: hosted- version: "2.0.0"+ version: "2.1.0-nullsafety.1"stream_transform:dependency: transitivedescription:@@ -739,7 +753,7 @@ packages:name: string_scannerurl: "https://pub.dartlang.org"source: hosted- version: "1.0.5"+ version: "1.1.0-nullsafety.1"supercharged:dependency: transitivedescription:@@ -760,14 +774,14 @@ packages:name: term_glyphurl: "https://pub.dartlang.org"source: hosted- version: "1.1.0"+ version: "1.2.0-nullsafety.1"test_api:dependency: transitivedescription:name: test_apiurl: "https://pub.dartlang.org"source: hosted- version: "0.2.17"+ version: "0.2.19-nullsafety.2"timing:dependency: transitivedescription:@@ -781,7 +795,7 @@ packages:name: typed_dataurl: "https://pub.dartlang.org"source: hosted- version: "1.2.0"+ version: "1.3.0-nullsafety.3"url_launcher:dependency: "direct main"description:@@ -830,7 +844,7 @@ packages:name: vector_mathurl: "https://pub.dartlang.org"source: hosted- version: "2.0.8"+ version: "2.1.0-nullsafety.3"watcher:dependency: transitivedescription:@@ -881,5 +895,5 @@ packages:source: hostedversion: "2.2.1"sdks:- dart: ">=2.9.0-16.0.dev <3.0.0"+ dart: ">=2.10.0-110 <2.11.0"flutter: ">=1.12.13+hotfix.5 <2.0.0"diff --git a/console/generic_app/pubspec.yaml b/console/generic_app/pubspec.yamlindex baf9e0906..4be2fae3c 100644--- a/console/generic_app/pubspec.yaml+++ b/console/generic_app/pubspec.yaml@@ -11,7 +11,7 @@ description: Generic app of OpenRemote# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.# Read more about iOS versioning at# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html-version: 1.0.1+16+version: 1.0.2+16environment:sdk: ">=2.2.0 <3.0.0"@@ -40,6 +40,8 @@ dependencies:awesome_dialog: ^1.2.0event_bus: ^1.1.1url_launcher: ^5.4.2+ firebase_core: ^0.5.0+ firebase_crashlytics: ^0.2.1+1dev_dependencies:flutter_test:diff --git a/console/iOS/GenericApp/GenericApp.xcodeproj/project.pbxproj b/console/iOS/GenericApp/GenericApp.xcodeproj/project.pbxprojindex ca12abd5a..f4c88ffbf 100644--- a/console/iOS/GenericApp/GenericApp.xcodeproj/project.pbxproj+++ b/console/iOS/GenericApp/GenericApp.xcodeproj/project.pbxproj@@ -7,19 +7,41 @@objects = {/* Begin PBXBuildFile section */+ 4C81AA642546B251006ED5DD /* ProjectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C81AA632546B251006ED5DD /* ProjectViewController.swift */; };+ 4C81AADD2546EB28006ED5DD /* ORTextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C81AADC2546EB28006ED5DD /* ORTextInput.swift */; };+ 4C81AAE62547124D006ED5DD /* UIColor+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C81AAE52547124D006ED5DD /* UIColor+Utils.swift */; };+ 4C81AB2D25472C7F006ED5DD /* String+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C81AB2C25472C7F006ED5DD /* String+Utils.swift */; };+ 4CEDA25D25405B1E00C47E3B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4CEDA25C25405B1E00C47E3B /* GoogleService-Info.plist */; };+ 4CEDA27B2540690300C47E3B /* ApiManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA27A2540690300C47E3B /* ApiManager.swift */; };+ 4CEDA27E25406A4400C47E3B /* ORAppConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA27D25406A4400C47E3B /* ORAppConfig.swift */; };+ 4CEDA28125406C1700C47E3B /* ORLinkConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA28025406C1700C47E3B /* ORLinkConfig.swift */; };+ 4CEDA2852540740C00C47E3B /* ORNotificationResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2832540740B00C47E3B /* ORNotificationResource.swift */; };+ 4CEDA28B2540742900C47E3B /* ORPushNotificationButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA28A2540742900C47E3B /* ORPushNotificationButton.swift */; };+ 4CEDA28C2540742900C47E3B /* ORPushNotificationAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2892540742900C47E3B /* ORPushNotificationAction.swift */; };+ 4CEDA2922540747D00C47E3B /* GeofenceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA28F2540747D00C47E3B /* GeofenceProvider.swift */; };+ 4CEDA2932540747D00C47E3B /* PushNotificationProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2902540747D00C47E3B /* PushNotificationProvider.swift */; };+ 4CEDA2942540747D00C47E3B /* StorageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2912540747D00C47E3B /* StorageProvider.swift */; };+ 4CEDA29A2540748C00C47E3B /* ErrorManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2992540748C00C47E3B /* ErrorManager.swift */; };+ 4CEDA29E254074A500C47E3B /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA29D254074A500C47E3B /* Constants.swift */; };+ 4CEDA2A1254074AB00C47E3B /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2A0254074AB00C47E3B /* Reachability.swift */; };+ 4CEDA2A4254074B900C47E3B /* ORViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2A3254074B900C47E3B /* ORViewController.swift */; };+ 4CEDA2A7254074D100C47E3B /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4CEDA2A6254074D100C47E3B /* Storyboard.storyboard */; };+ 4CEDA2CE254075D400C47E3B /* SplashViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2CD254075D400C47E3B /* SplashViewController.swift */; };+ 4CEDA2D02540765D00C47E3B /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA29D254074A500C47E3B /* Constants.swift */; };+ 4CEDA2D22540768700C47E3B /* ORLinkConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA28025406C1700C47E3B /* ORLinkConfig.swift */; };+ 4CEDA2D32540768700C47E3B /* ORPushNotificationAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2892540742900C47E3B /* ORPushNotificationAction.swift */; };+ 4CEDA2D42540768700C47E3B /* ORAppConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA27D25406A4400C47E3B /* ORAppConfig.swift */; };+ 4CEDA2D52540768700C47E3B /* ORPushNotificationButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA28A2540742900C47E3B /* ORPushNotificationButton.swift */; };+ 4CEDA2E72540768B00C47E3B /* ORNotificationResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA2832540740B00C47E3B /* ORNotificationResource.swift */; };+ 4CEDA2E92540770200C47E3B /* GeofenceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CEDA28F2540747D00C47E3B /* GeofenceProvider.swift */; };5952998DA2B50AFF73DDCAE1 /* Pods_NotificationService.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570B5A477F4AA747A62A45EF /* Pods_NotificationService.framework */; };756FA8BF24545CB0CC18CA6E /* Pods_GenericApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E012F268F107177E6B242E8 /* Pods_GenericApp.framework */; };878D2D0D249A490300011484 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878D2D0C249A490300011484 /* AppDelegate.swift */; };- 878D2D0F249A490300011484 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878D2D0E249A490300011484 /* SceneDelegate.swift */; };- 878D2D11249A490300011484 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878D2D10249A490300011484 /* ContentView.swift */; };878D2D13249A490400011484 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 878D2D12249A490400011484 /* Assets.xcassets */; };878D2D16249A490400011484 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 878D2D15249A490400011484 /* Preview Assets.xcassets */; };878D2D19249A490400011484 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 878D2D17249A490400011484 /* LaunchScreen.storyboard */; };878D2D27249A498900011484 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878D2D26249A498900011484 /* NotificationService.swift */; };878D2D2B249A498900011484 /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 878D2D24249A498900011484 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };- 878D2D31249A4D3700011484 /* ORLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 878D2D30249A4D3700011484 /* ORLib.framework */; };- 878D2D32249A4D3700011484 /* ORLib.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 878D2D30249A4D3700011484 /* ORLib.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };- 878D2D36249A50FC00011484 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878D2D35249A50FC00011484 /* LoginView.swift */; };/* End PBXBuildFile section *//* Begin PBXContainerItemProxy section */@@ -44,28 +66,37 @@name = "Embed App Extensions";runOnlyForDeploymentPostprocessing = 0;};- 878D2D33249A4D3700011484 /* Embed Frameworks */ = {- isa = PBXCopyFilesBuildPhase;- buildActionMask = 2147483647;- dstPath = "";- dstSubfolderSpec = 10;- files = (- 878D2D32249A4D3700011484 /* ORLib.framework in Embed Frameworks */,- );- name = "Embed Frameworks";- runOnlyForDeploymentPostprocessing = 0;- };/* End PBXCopyFilesBuildPhase section *//* Begin PBXFileReference section */3B0E05618605D241D5A82AA3 /* Pods-NotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.debug.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.debug.xcconfig"; sourceTree = "<group>"; };46FD90D41833A0E2C4C7DDA6 /* Pods-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.release.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.release.xcconfig"; sourceTree = "<group>"; };+ 4C81AA632546B251006ED5DD /* ProjectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProjectViewController.swift; sourceTree = "<group>"; };+ 4C81AADC2546EB28006ED5DD /* ORTextInput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORTextInput.swift; sourceTree = "<group>"; };+ 4C81AAE0254709EC006ED5DD /* NotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NotificationService.entitlements; sourceTree = "<group>"; };+ 4C81AAE52547124D006ED5DD /* UIColor+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Utils.swift"; sourceTree = "<group>"; };+ 4C81AB2C25472C7F006ED5DD /* String+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Utils.swift"; sourceTree = "<group>"; };+ 4CEDA259254042A900C47E3B /* OpenRemote.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OpenRemote.entitlements; sourceTree = "<group>"; };+ 4CEDA25C25405B1E00C47E3B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };+ 4CEDA27A2540690300C47E3B /* ApiManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiManager.swift; sourceTree = "<group>"; };+ 4CEDA27D25406A4400C47E3B /* ORAppConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORAppConfig.swift; sourceTree = "<group>"; };+ 4CEDA28025406C1700C47E3B /* ORLinkConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORLinkConfig.swift; sourceTree = "<group>"; };+ 4CEDA2832540740B00C47E3B /* ORNotificationResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORNotificationResource.swift; sourceTree = "<group>"; };+ 4CEDA2892540742900C47E3B /* ORPushNotificationAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORPushNotificationAction.swift; sourceTree = "<group>"; };+ 4CEDA28A2540742900C47E3B /* ORPushNotificationButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORPushNotificationButton.swift; sourceTree = "<group>"; };+ 4CEDA28F2540747D00C47E3B /* GeofenceProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeofenceProvider.swift; sourceTree = "<group>"; };+ 4CEDA2902540747D00C47E3B /* PushNotificationProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushNotificationProvider.swift; sourceTree = "<group>"; };+ 4CEDA2912540747D00C47E3B /* StorageProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageProvider.swift; sourceTree = "<group>"; };+ 4CEDA2992540748C00C47E3B /* ErrorManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorManager.swift; sourceTree = "<group>"; };+ 4CEDA29D254074A500C47E3B /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };+ 4CEDA2A0254074AB00C47E3B /* Reachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };+ 4CEDA2A3254074B900C47E3B /* ORViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORViewController.swift; sourceTree = "<group>"; };+ 4CEDA2A6254074D100C47E3B /* Storyboard.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = "<group>"; };+ 4CEDA2CD254075D400C47E3B /* SplashViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = "<group>"; };4E012F268F107177E6B242E8 /* Pods_GenericApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GenericApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };570B5A477F4AA747A62A45EF /* Pods_NotificationService.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NotificationService.framework; sourceTree = BUILT_PRODUCTS_DIR; };878D2D09249A490300011484 /* OpenRemote.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRemote.app; sourceTree = BUILT_PRODUCTS_DIR; };878D2D0C249A490300011484 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };- 878D2D0E249A490300011484 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };- 878D2D10249A490300011484 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };878D2D12249A490400011484 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };878D2D15249A490400011484 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };878D2D18249A490400011484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };@@ -74,7 +105,6 @@878D2D26249A498900011484 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };878D2D28249A498900011484 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };878D2D30249A4D3700011484 /* ORLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ORLib.framework; sourceTree = BUILT_PRODUCTS_DIR; };- 878D2D35249A50FC00011484 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };A994B3D3E3853BA4D16AA5A8 /* Pods-GenericApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GenericApp.debug.xcconfig"; path = "Target Support Files/Pods-GenericApp/Pods-GenericApp.debug.xcconfig"; sourceTree = "<group>"; };D61E1E0434CC1446EAF20BA0 /* Pods-GenericApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GenericApp.release.xcconfig"; path = "Target Support Files/Pods-GenericApp/Pods-GenericApp.release.xcconfig"; sourceTree = "<group>"; };/* End PBXFileReference section */@@ -93,13 +123,53 @@buildActionMask = 2147483647;files = (5952998DA2B50AFF73DDCAE1 /* Pods_NotificationService.framework in Frameworks */,- 878D2D31249A4D3700011484 /* ORLib.framework in Frameworks */,);runOnlyForDeploymentPostprocessing = 0;};/* End PBXFrameworksBuildPhase section *//* Begin PBXGroup section */+ 4CEDA264254068D700C47E3B /* Models */ = {+ isa = PBXGroup;+ children = (+ 4CEDA27D25406A4400C47E3B /* ORAppConfig.swift */,+ 4CEDA28025406C1700C47E3B /* ORLinkConfig.swift */,+ 4CEDA2892540742900C47E3B /* ORPushNotificationAction.swift */,+ 4CEDA28A2540742900C47E3B /* ORPushNotificationButton.swift */,+ );+ path = Models;+ sourceTree = "<group>";+ };+ 4CEDA279254068DD00C47E3B /* Network */ = {+ isa = PBXGroup;+ children = (+ 4CEDA27A2540690300C47E3B /* ApiManager.swift */,+ 4CEDA2832540740B00C47E3B /* ORNotificationResource.swift */,+ );+ path = Network;+ sourceTree = "<group>";+ };+ 4CEDA28E2540747400C47E3B /* ConsoleProviders */ = {+ isa = PBXGroup;+ children = (+ 4CEDA2912540747D00C47E3B /* StorageProvider.swift */,+ 4CEDA28F2540747D00C47E3B /* GeofenceProvider.swift */,+ 4CEDA2902540747D00C47E3B /* PushNotificationProvider.swift */,+ );+ path = ConsoleProviders;+ sourceTree = "<group>";+ };+ 4CEDA29C2540749B00C47E3B /* Utils */ = {+ isa = PBXGroup;+ children = (+ 4CEDA2A0254074AB00C47E3B /* Reachability.swift */,+ 4CEDA29D254074A500C47E3B /* Constants.swift */,+ 4C81AAE52547124D006ED5DD /* UIColor+Utils.swift */,+ 4C81AB2C25472C7F006ED5DD /* String+Utils.swift */,+ );+ path = Utils;+ sourceTree = "<group>";+ };6E621588C821060939F236DC /* Pods */ = {isa = PBXGroup;children = (@@ -134,12 +204,17 @@878D2D0B249A490300011484 /* GenericApp */ = {isa = PBXGroup;children = (+ 4CEDA29C2540749B00C47E3B /* Utils */,+ 4CEDA28E2540747400C47E3B /* ConsoleProviders */,+ 4CEDA279254068DD00C47E3B /* Network */,+ 4CEDA264254068D700C47E3B /* Models */,+ 4CEDA25C25405B1E00C47E3B /* GoogleService-Info.plist */,+ 4CEDA259254042A900C47E3B /* OpenRemote.entitlements */,878D2D34249A50E500011484 /* UI */,878D2D0C249A490300011484 /* AppDelegate.swift */,- 878D2D0E249A490300011484 /* SceneDelegate.swift */,- 878D2D10249A490300011484 /* ContentView.swift */,878D2D12249A490400011484 /* Assets.xcassets */,878D2D17249A490400011484 /* LaunchScreen.storyboard */,+ 4CEDA2A6254074D100C47E3B /* Storyboard.storyboard */,878D2D1A249A490400011484 /* Info.plist */,878D2D14249A490400011484 /* Preview Content */,);@@ -157,6 +232,7 @@878D2D25249A498900011484 /* NotificationService */ = {isa = PBXGroup;children = (+ 4C81AAE0254709EC006ED5DD /* NotificationService.entitlements */,878D2D26249A498900011484 /* NotificationService.swift */,878D2D28249A498900011484 /* Info.plist */,);@@ -166,7 +242,11 @@878D2D34249A50E500011484 /* UI */ = {isa = PBXGroup;children = (- 878D2D35249A50FC00011484 /* LoginView.swift */,+ 4CEDA2992540748C00C47E3B /* ErrorManager.swift */,+ 4CEDA2A3254074B900C47E3B /* ORViewController.swift */,+ 4CEDA2CD254075D400C47E3B /* SplashViewController.swift */,+ 4C81AA632546B251006ED5DD /* ProjectViewController.swift */,+ 4C81AADC2546EB28006ED5DD /* ORTextInput.swift */,);path = UI;sourceTree = "<group>";@@ -213,7 +293,6 @@878D2D20249A498900011484 /* Sources */,878D2D21249A498900011484 /* Frameworks */,878D2D22249A498900011484 /* Resources */,- 878D2D33249A4D3700011484 /* Embed Frameworks */,);buildRules = ();@@ -231,7 +310,7 @@isa = PBXProject;attributes = {LastSwiftUpdateCheck = 1140;- LastUpgradeCheck = 1140;+ LastUpgradeCheck = 1200;ORGANIZATIONNAME = OpenRemote;TargetAttributes = {878D2D08249A490300011484 = {@@ -267,8 +346,10 @@buildActionMask = 2147483647;files = (878D2D19249A490400011484 /* LaunchScreen.storyboard in Resources */,+ 4CEDA25D25405B1E00C47E3B /* GoogleService-Info.plist in Resources */,878D2D16249A490400011484 /* Preview Assets.xcassets in Resources */,878D2D13249A490400011484 /* Assets.xcassets in Resources */,+ 4CEDA2A7254074D100C47E3B /* Storyboard.storyboard in Resources */,);runOnlyForDeploymentPostprocessing = 0;};@@ -350,10 +431,25 @@isa = PBXSourcesBuildPhase;buildActionMask = 2147483647;files = (+ 4CEDA2922540747D00C47E3B /* GeofenceProvider.swift in Sources */,+ 4CEDA29E254074A500C47E3B /* Constants.swift in Sources */,+ 4C81AA642546B251006ED5DD /* ProjectViewController.swift in Sources */,878D2D0D249A490300011484 /* AppDelegate.swift in Sources */,- 878D2D0F249A490300011484 /* SceneDelegate.swift in Sources */,- 878D2D36249A50FC00011484 /* LoginView.swift in Sources */,- 878D2D11249A490300011484 /* ContentView.swift in Sources */,+ 4CEDA29A2540748C00C47E3B /* ErrorManager.swift in Sources */,+ 4CEDA2932540747D00C47E3B /* PushNotificationProvider.swift in Sources */,+ 4CEDA2CE254075D400C47E3B /* SplashViewController.swift in Sources */,+ 4CEDA28125406C1700C47E3B /* ORLinkConfig.swift in Sources */,+ 4CEDA2942540747D00C47E3B /* StorageProvider.swift in Sources */,+ 4C81AAE62547124D006ED5DD /* UIColor+Utils.swift in Sources */,+ 4C81AADD2546EB28006ED5DD /* ORTextInput.swift in Sources */,+ 4CEDA2A4254074B900C47E3B /* ORViewController.swift in Sources */,+ 4C81AB2D25472C7F006ED5DD /* String+Utils.swift in Sources */,+ 4CEDA27E25406A4400C47E3B /* ORAppConfig.swift in Sources */,+ 4CEDA28B2540742900C47E3B /* ORPushNotificationButton.swift in Sources */,+ 4CEDA28C2540742900C47E3B /* ORPushNotificationAction.swift in Sources */,+ 4CEDA27B2540690300C47E3B /* ApiManager.swift in Sources */,+ 4CEDA2A1254074AB00C47E3B /* Reachability.swift in Sources */,+ 4CEDA2852540740C00C47E3B /* ORNotificationResource.swift in Sources */,);runOnlyForDeploymentPostprocessing = 0;};@@ -361,7 +457,14 @@isa = PBXSourcesBuildPhase;buildActionMask = 2147483647;files = (+ 4CEDA2E92540770200C47E3B /* GeofenceProvider.swift in Sources */,+ 4CEDA2D22540768700C47E3B /* ORLinkConfig.swift in Sources */,878D2D27249A498900011484 /* NotificationService.swift in Sources */,+ 4CEDA2D02540765D00C47E3B /* Constants.swift in Sources */,+ 4CEDA2D52540768700C47E3B /* ORPushNotificationButton.swift in Sources */,+ 4CEDA2E72540768B00C47E3B /* ORNotificationResource.swift in Sources */,+ 4CEDA2D32540768700C47E3B /* ORPushNotificationAction.swift in Sources */,+ 4CEDA2D42540768700C47E3B /* ORAppConfig.swift in Sources */,);runOnlyForDeploymentPostprocessing = 0;};@@ -413,6 +516,7 @@CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;CLANG_WARN_STRICT_PROTOTYPES = YES;CLANG_WARN_SUSPICIOUS_MOVE = YES;@@ -473,6 +577,7 @@CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;CLANG_WARN_STRICT_PROTOTYPES = YES;CLANG_WARN_SUSPICIOUS_MOVE = YES;@@ -507,7 +612,9 @@buildSettings = {ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CODE_SIGN_ENTITLEMENTS = GenericApp/OpenRemote.entitlements;CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 17;DEVELOPMENT_ASSET_PATHS = "\"GenericApp/Preview Content\"";DEVELOPMENT_TEAM = 4AC88KZHJZ;ENABLE_PREVIEWS = YES;@@ -516,10 +623,11 @@"$(inherited)","@executable_path/Frameworks",);+ MARKETING_VERSION = 1.0.2;PRODUCT_BUNDLE_IDENTIFIER = io.openremote.app;PRODUCT_NAME = OpenRemote;SWIFT_VERSION = 5.0;- TARGETED_DEVICE_FAMILY = "1,2";+ TARGETED_DEVICE_FAMILY = 1;};name = Debug;};@@ -529,7 +637,9 @@buildSettings = {ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;+ CODE_SIGN_ENTITLEMENTS = GenericApp/OpenRemote.entitlements;CODE_SIGN_STYLE = Automatic;+ CURRENT_PROJECT_VERSION = 17;DEVELOPMENT_ASSET_PATHS = "\"GenericApp/Preview Content\"";DEVELOPMENT_TEAM = 4AC88KZHJZ;ENABLE_PREVIEWS = YES;@@ -538,10 +648,11 @@"$(inherited)","@executable_path/Frameworks",);+ MARKETING_VERSION = 1.0.2;PRODUCT_BUNDLE_IDENTIFIER = io.openremote.app;PRODUCT_NAME = OpenRemote;SWIFT_VERSION = 5.0;- TARGETED_DEVICE_FAMILY = "1,2";+ TARGETED_DEVICE_FAMILY = 1;};name = Release;};@@ -549,6 +660,7 @@isa = XCBuildConfiguration;baseConfigurationReference = 3B0E05618605D241D5A82AA3 /* Pods-NotificationService.debug.xcconfig */;buildSettings = {+ CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;CODE_SIGN_STYLE = Automatic;DEVELOPMENT_TEAM = 4AC88KZHJZ;INFOPLIST_FILE = NotificationService/Info.plist;@@ -569,6 +681,7 @@isa = XCBuildConfiguration;baseConfigurationReference = 46FD90D41833A0E2C4C7DDA6 /* Pods-NotificationService.release.xcconfig */;buildSettings = {+ CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;CODE_SIGN_STYLE = Automatic;DEVELOPMENT_TEAM = 4AC88KZHJZ;INFOPLIST_FILE = NotificationService/Info.plist;diff --git a/console/iOS/GenericApp/GenericApp/AppDelegate.swift b/console/iOS/GenericApp/GenericApp/AppDelegate.swiftindex 5d7f20b0a..b581c357e 100644--- a/console/iOS/GenericApp/GenericApp/AppDelegate.swift+++ b/console/iOS/GenericApp/GenericApp/AppDelegate.swift@@ -2,37 +2,337 @@// AppDelegate.swift// GenericApp//-// Created by nuc on 17/06/2020.-// Copyright © 2020 OpenRemote. All rights reserved.+// Created by Michael Rademaker on 17/06/2020.+// Copyright © 2020 Remote. All rights reserved.//import UIKit-import ORLib+import Firebase+import CoreLocation@UIApplicationMain-class AppDelegate: UIResponder, UIApplicationDelegate {+class AppDelegate: UIResponder, UIApplicationDelegate, URLSessionDelegate {+ var window: UIWindow?+ let gcmMessageIDKey = "gcm.message_id"+ var reachabilityAlert : UIAlertController?+ var reachabilityAlertShown = false+ let internetReachability = Reachability()+ var geofenceProvider : GeofenceProvider?+ var fcmToken: String?func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {- // Override point for customization after application launch.+ UNUserNotificationCenter.current().delegate = self+ // if the app was launched because of geofencing++ let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)+ let documentsDirectory = paths[0]+ let fileName = "\(Date()).log"+ let logFilePath = (documentsDirectory as NSString).appendingPathComponent(fileName)+ freopen(logFilePath.cString(using: String.Encoding.ascii)!, "a+", stderr)++ if launchOptions?[UIApplication.LaunchOptionsKey.location] != nil {+ NSLog("%@", "App started from location update")+ // create new GeofenceProvider which creates a CLLocationManager that will receive the location update+ geofenceProvider = GeofenceProvider()+ if CLLocationManager.authorizationStatus() == .authorizedAlways {+ geofenceProvider?.locationManager.startMonitoringSignificantLocationChanges()+ }+ } else if let remoteNotifcation = launchOptions?[UIApplication.LaunchOptionsKey.remoteNotification] as? [AnyHashable: Any] {+ NSLog("%@", "App started from remote notification")+ if let action = remoteNotifcation[DefaultsKey.actionKey] as? String {+ if action == Actions.geofenceRefresh {+ geofenceProvider = GeofenceProvider()+ geofenceProvider?.refreshGeofences()+ if CLLocationManager.authorizationStatus() == .authorizedAlways {+ geofenceProvider?.locationManager.startMonitoringSignificantLocationChanges()+ }+ }+ }+ } else {+ FirebaseApp.configure()+ Messaging.messaging().delegate = self++ NotificationCenter.default.addObserver(self,+ selector: #selector(self.reachabilityChanged(note:)),+ name: NSNotification.Name.reachabilityChanged,+ object: internetReachability)+ do {+ try internetReachability?.startNotifier()+ self.updateReachabilityStatus(reachability: internetReachability!)+ } catch {+ NSLog("%@", "Unable to start notifier")+ }+ }return true}- // MARK: UISceneSession Lifecycle+ func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {+ if shortcutItem.type == "projects" {+ let userDefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement)+ userDefaults?.removeObject(forKey: DefaultsKey.projectKey)+ userDefaults?.removeObject(forKey: DefaultsKey.realmKey)++ self.window?.rootViewController?.dismiss(animated: true, completion: nil)+ }+ }++ func applicationWillResignActive(_ application: UIApplication) {+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.+ // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.+ reachabilityAlert?.dismiss(animated: true, completion: nil)+ reachabilityAlertShown = false+ internetReachability?.stopNotifier()+ }++ func applicationDidEnterBackground(_ application: UIApplication) {+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.+ reachabilityAlert?.dismiss(animated: true, completion: nil)+ reachabilityAlertShown = false+ internetReachability?.stopNotifier()+ }++ func applicationWillEnterForeground(_ application: UIApplication) {+ // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.+ DispatchQueue.main.asyncAfter(deadline: .now() + 3) {+ do {+ try self.internetReachability?.startNotifier()+ self.updateReachabilityStatus(reachability: self.internetReachability!)+ } catch {+ NSLog("%@", "Unable to start notifier")+ }+ }+ }++ func applicationDidBecomeActive(_ application: UIApplication) {+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.+ DispatchQueue.main.asyncAfter(deadline: .now() + 3) {+ do {+ try self.internetReachability?.startNotifier()+ self.updateReachabilityStatus(reachability: self.internetReachability!)+ } catch {+ NSLog("%@", "Unable to start notifier")+ }+ }+ }++ func applicationWillTerminate(_ application: UIApplication) {+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.+ reachabilityAlert?.dismiss(animated: true, completion: nil)+ reachabilityAlertShown = false+ internetReachability?.stopNotifier()+ }++ func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {+ Messaging.messaging().apnsToken = deviceToken+ }++ func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {+ if let action = userInfo[DefaultsKey.actionKey] as? String {+ if action == Actions.geofenceRefresh {+ if let controllerGeofenceProvider = (self.window?.rootViewController as! ORViewcontroller).geofenceProvider {+ controllerGeofenceProvider.refreshGeofences()+ } else if let delegateGeofenceProvider = geofenceProvider {+ delegateGeofenceProvider.refreshGeofences()+ } else {+ geofenceProvider = GeofenceProvider()+ geofenceProvider!.refreshGeofences()+ }+ } else if action == Actions.store {+ if let data = userInfo[DefaultsKey.dataKey] as? [String: String] {+ if let key = data["key"] {+ if let storageProvider = (self.window?.rootViewController as! ORViewcontroller).storageProvider {+ storageProvider.store(key: key, data: data["value"])+ }+ }+ }+ }+ }++ if let notificationIdString = userInfo[ActionType.notificationId] as? String, let notificationId = Int64(notificationIdString) {+ if let defaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement), let consoleId = defaults.string(forKey: GeofenceProvider.consoleIdKey) {+ ORNotificationResource.sharedInstance.notificationDelivered(notificationId: notificationId, targetId: consoleId)+ }+ }+ completionHandler(UIBackgroundFetchResult.newData)+ }++ @objc func reachabilityChanged(note: NSNotification) {+ if let reachability = note.object as? Reachability {+ updateReachabilityStatus(reachability: reachability)+ }+ }++ private func updateReachabilityStatus(reachability: Reachability) {+ if reachability.connection == .none {+ if (!reachabilityAlertShown) {+ let topWindow = UIWindow(frame: UIScreen.main.bounds)+ topWindow.rootViewController = UIViewController()+ topWindow.windowLevel = UIWindow.Level.alert + 1++ reachabilityAlert = UIAlertController(title: "Network Error", message: "Your device seems to be offline", preferredStyle: .alert)+ let reachabilityRetryAction = UIAlertAction(title: "Retry", style: .default, handler: { (action) in+ self.reachabilityAlertShown = false+ self.updateReachabilityStatus(reachability: self.internetReachability!)+ topWindow.isHidden = true+ })+ let reachabilityCancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: { (action) in+ self.reachabilityAlertShown = false+ self.reachabilityAlert?.dismiss(animated: true, completion: nil)+ topWindow.isHidden = true+ })+ reachabilityAlert?.addAction(reachabilityRetryAction)+ reachabilityAlert?.addAction(reachabilityCancelAction)+ topWindow.makeKeyAndVisible()+ topWindow.rootViewController?.present(reachabilityAlert!, animated: true, completion: nil)+ reachabilityAlertShown = true+ }+ } else {+ if (reachabilityAlertShown) {+ reachabilityAlert?.dismiss(animated: true, completion: nil)+ reachabilityAlertShown = false+ }+ }+ }- func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {- // Called when a new scene session is being created.- // Use this method to select a configuration to create the new scene with.- return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)+ func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {+ if (challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust) {+ completionHandler(.performDefaultHandling, nil)+ }}+}++extension AppDelegate : UNUserNotificationCenterDelegate {++ func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {+ let userInfo = notification.request.content.userInfo+ var notificationId : Int64? = nil++ if let notificationIdString = userInfo[ActionType.notificationId] as? String{+ notificationId = Int64(notificationIdString)+ }+ if let notiId = notificationId, let defaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement), let consoleId = defaults.string(forKey: GeofenceProvider.consoleIdKey) {+ ORNotificationResource.sharedInstance.notificationDelivered(notificationId: notiId, targetId: consoleId)+ }- func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {- // Called when the user discards a scene session.- // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.- // Use this method to release any resources that were specific to the discarded scenes, as they will not return.+ completionHandler([.alert, .sound])}+ func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {+ let userInfo = response.notification.request.content.userInfo+ var notificationId : Int64? = nil+ var consoleId : String?+ var project: String?+ var realm: String?++ if let notificationIdString = userInfo[ActionType.notificationId] as? String{+ notificationId = Int64(notificationIdString)+ }++ if let defaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement) {+ consoleId = defaults.string(forKey: GeofenceProvider.consoleIdKey)+ project = defaults.string(forKey: DefaultsKey.projectKey)+ realm = defaults.string(forKey: DefaultsKey.realmKey)+ }++ NSLog("%@", "Action chosen: \(response.actionIdentifier)")++ switch response.actionIdentifier {+ case UNNotificationDefaultActionIdentifier:+ if let urlTo = userInfo[ActionType.appUrl] as? String, !urlTo.isEmpty {+ var urlRequest: URL?+ if urlTo.hasPrefix("http") || urlTo.hasPrefix("https") {+ urlRequest = URL(string:urlTo)+ } else {+ if let projectName = project, let realmName = realm {+ urlRequest = URL(string: "https://\(projectName).remote.io/\(realmName)/console/\(urlTo)")+ }+ }+ if let url = urlRequest{+ if let InBrowser = userInfo[ActionType.openInBrowser] as? Bool, InBrowser {+ NSLog("%@", " in browser: \(url)")+ UIApplication.shared.open(url)+ } else {+ NSLog("%@", " in app: \(url)")+ (self.window?.rootViewController as! ORViewcontroller).loadURL(url:url)+ }+ }+ }+ case UNNotificationDismissActionIdentifier,+ "declineAction":+ if let notiId = notificationId, let conId = consoleId {+ ORNotificationResource.sharedInstance.notificationAcknowledged(notificationId: notiId, targetId: conId, acknowledgement: response.actionIdentifier)+ }+ default :+ if let notiId = notificationId, let conId = consoleId {+ ORNotificationResource.sharedInstance.notificationAcknowledged(notificationId: notiId, targetId: conId, acknowledgement: response.actionIdentifier)+ }+ if let buttonsString = userInfo[DefaultsKey.buttonsKey] as? String {+ if let buttonsData = buttonsString.data(using: .utf8) {+ if let buttons = try? JSONDecoder().decode([ORPushNotificationButton].self, from: buttonsData) {+ for button in buttons {+ if button.title == response.actionIdentifier {+ if let action = button.action {+ var urlRequest: URL?+ if action.url.hasPrefix("http") || action.url.hasPrefix("https") {+ urlRequest = URL(string:action.url)+ } else {+ if let projectName = project, let realmName = realm {+ urlRequest = URL(string: "https://\(projectName).remote.io/\(realmName)/console/\(action.url)")+ }+ }+ if let url = urlRequest {+ if action.silent {+ let request = NSMutableURLRequest(url: url)+ request.httpMethod = action.httpMethod ?? "GET"+ if let body = action.data {+ request.httpBody = body.data(using: .utf8)+ request.addValue("application/json", forHTTPHeaderField: "Content-Type")+ }+ let session = URLSession(configuration: URLSessionConfiguration.default, delegate: nil, delegateQueue : nil)+ let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler:{ data, response, error in+ if (error != nil) {+ NSLog("error %@", (error! as NSError).localizedDescription)+ }+ })+ reqDataTask.resume()+ } else if action.openInBrowser {+ NSLog("%@", " in browser: \(url)")+ UIApplication.shared.open(url)+ } else {+ NSLog("%@", " in app: \(url)")+ (self.window?.rootViewController as! ORViewcontroller).loadURL(url:url)+ }+ }+ }+ break+ }+ }+ }+ }+ }+ }+ completionHandler()+ }}+extension AppDelegate : MessagingDelegate {+ func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {+ print("Firebase registration token: \(fcmToken)")+ if let defaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement){+ defaults.set(fcmToken, forKey: DefaultsKey.fcmTokenKey)+ defaults.synchronize()+ }+ }++ func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {+ print("Firebase registration token: \(fcmToken)")+ if let defaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement) {+ defaults.set(fcmToken, forKey: DefaultsKey.fcmTokenKey)+ defaults.synchronize()+ }+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/Contents.jsonindex 9221b9bb1..19f7ff69a 100644--- a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/Contents.json+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/Contents.json@@ -1,91 +1,109 @@{"images" : [{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "2x","size" : "20x20"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "3x","size" : "20x20"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "2x","size" : "29x29"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "3x","size" : "29x29"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "2x","size" : "40x40"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "3x","size" : "40x40"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "2x","size" : "60x60"},{+ "filename" : "[email protected]","idiom" : "iphone","scale" : "3x","size" : "60x60"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "1x","size" : "20x20"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "2x","size" : "20x20"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "1x","size" : "29x29"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "2x","size" : "29x29"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "1x","size" : "40x40"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "2x","size" : "40x40"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "1x","size" : "76x76"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "2x","size" : "76x76"},{+ "filename" : "[email protected]","idiom" : "ipad","scale" : "2x","size" : "83.5x83.5"},{+ "filename" : "[email protected]","idiom" : "ios-marketing","scale" : "1x","size" : "1024x1024"diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..ad43546ffBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..6e3e1c94fBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..399abf5a0Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..399abf5a0Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..22c6080afBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..98be8ad89Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..297f1f1f8Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..297f1f1f8Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..e382dff07Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..399abf5a0Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..9b51cabd3Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..9b51cabd3Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..1bf66a183Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..1bf66a183Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..692c9eecfBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..14bb13149Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..a7526578eBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected]new file mode 100644index 000000000..34cbe60d0Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/AppIcon.appiconset/[email protected] differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo-mobile.imageset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_menu.imageset/Contents.jsonsimilarity index 87%rename from console/iOS/GenericApp/GenericApp/Assets.xcassets/logo-mobile.imageset/Contents.jsonrename to console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_menu.imageset/Contents.jsonindex b0da3f097..3663ba557 100644--- a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo-mobile.imageset/Contents.json+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_menu.imageset/Contents.json@@ -9,7 +9,7 @@"scale" : "2x"},{- "filename" : "logo-mobile.png",+ "filename" : "menu_ic.png","idiom" : "universal","scale" : "3x"}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_menu.imageset/menu_ic.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_menu.imageset/menu_ic.pngnew file mode 100644index 000000000..32d1c1245Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_menu.imageset/menu_ic.png differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo.imageset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_settings.imageset/Contents.jsonsimilarity index 89%rename from console/iOS/GenericApp/GenericApp/Assets.xcassets/logo.imageset/Contents.jsonrename to console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_settings.imageset/Contents.jsonindex aae68a599..679782945 100644--- a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo.imageset/Contents.json+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_settings.imageset/Contents.json@@ -9,7 +9,7 @@"scale" : "2x"},{- "filename" : "logo.png",+ "filename" : "cog.png","idiom" : "universal","scale" : "3x"}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_settings.imageset/cog.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_settings.imageset/cog.pngnew file mode 100644index 000000000..7d7d8c246Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/ic_settings.imageset/cog.png differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo-mobile.imageset/logo-mobile.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo-mobile.imageset/logo-mobile.pngdeleted file mode 100644index 15ace0048..000000000Binary files a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo-mobile.imageset/logo-mobile.png and /dev/null differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo.imageset/logo.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo.imageset/logo.pngdeleted file mode 100644index 2179b259d..000000000Binary files a/console/iOS/GenericApp/GenericApp/Assets.xcassets/logo.imageset/logo.png and /dev/null differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_app_icon.imageset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_app_icon.imageset/Contents.jsonnew file mode 100644index 000000000..2cf7a5dd9--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_app_icon.imageset/Contents.json@@ -0,0 +1,21 @@+{+ "images" : [+ {+ "filename" : "or_app_icon.png",+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_app_icon.imageset/or_app_icon.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_app_icon.imageset/or_app_icon.pngnew file mode 100644index 000000000..34fed749aBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_app_icon.imageset/or_app_icon.png differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_green.colorset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_green.colorset/Contents.jsonnew file mode 100644index 000000000..a8574edeb--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_green.colorset/Contents.json@@ -0,0 +1,38 @@+{+ "colors" : [+ {+ "color" : {+ "color-space" : "srgb",+ "components" : {+ "alpha" : "1.000",+ "blue" : "0.176",+ "green" : "0.612",+ "red" : "0.290"+ }+ },+ "idiom" : "universal"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "color" : {+ "color-space" : "srgb",+ "components" : {+ "alpha" : "1.000",+ "blue" : "0.176",+ "green" : "0.610",+ "red" : "0.291"+ }+ },+ "idiom" : "universal"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_logo.imageset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_logo.imageset/Contents.jsonnew file mode 100644index 000000000..1f438e1ed--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_logo.imageset/Contents.json@@ -0,0 +1,21 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "filename" : "or_logo.png",+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_logo.imageset/or_logo.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_logo.imageset/or_logo.pngnew file mode 100644index 000000000..d7154867eBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_logo.imageset/or_logo.png differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_push_icon.imageset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_push_icon.imageset/Contents.jsonnew file mode 100644index 000000000..48b1cc11b--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_push_icon.imageset/Contents.json@@ -0,0 +1,21 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "filename" : "or_push_icon.png",+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_push_icon.imageset/or_push_icon.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_push_icon.imageset/or_push_icon.pngnew file mode 100644index 000000000..e1020884eBinary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_push_icon.imageset/or_push_icon.png differdiff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_splash.imageset/Contents.json b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_splash.imageset/Contents.jsonnew file mode 100644index 000000000..3f4263d72--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_splash.imageset/Contents.json@@ -0,0 +1,21 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "filename" : "or_splash.png",+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_splash.imageset/or_splash.png b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_splash.imageset/or_splash.pngnew file mode 100644index 000000000..0464d21b3Binary files /dev/null and b/console/iOS/GenericApp/GenericApp/Assets.xcassets/or_splash.imageset/or_splash.png differdiff --git a/console/iOS/GenericApp/GenericApp/Base.lproj/LaunchScreen.storyboard b/console/iOS/GenericApp/GenericApp/Base.lproj/LaunchScreen.storyboardindex 865e9329f..e52820446 100644--- a/console/iOS/GenericApp/GenericApp/Base.lproj/LaunchScreen.storyboard+++ b/console/iOS/GenericApp/GenericApp/Base.lproj/LaunchScreen.storyboard@@ -1,8 +1,11 @@-<?xml version="1.0" encoding="UTF-8" standalone="no"?>-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">+<?xml version="1.0" encoding="UTF-8"?>+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">+ <device id="retina6_1" orientation="portrait" appearance="light"/><dependencies>- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>+ <deployment identifier="iOS"/>+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/><capability name="Safe area layout guides" minToolsVersion="9.0"/>+ <capability name="System colors in document resources" minToolsVersion="11.0"/><capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/></dependencies><scenes>@@ -11,10 +14,23 @@<objects><viewController id="01J-lp-oVM" sceneMemberID="viewController"><view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">- <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/><autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>- <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>+ <subviews>+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="or_splash" translatesAutoresizingMaskIntoConstraints="NO" id="fI1-QA-sUs">+ <rect key="frame" x="87" y="328" width="240" height="240"/>+ <constraints>+ <constraint firstAttribute="height" constant="240" id="J3b-kj-bPA"/>+ <constraint firstAttribute="width" constant="240" id="K03-31-hxl"/>+ </constraints>+ </imageView>+ </subviews><viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>+ <constraints>+ <constraint firstItem="fI1-QA-sUs" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="35d-6S-AZA"/>+ <constraint firstItem="fI1-QA-sUs" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="jpP-ab-84p"/>+ </constraints></view></viewController><placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>@@ -22,4 +38,10 @@<point key="canvasLocation" x="53" y="375"/></scene></scenes>+ <resources>+ <image name="or_splash" width="1422.6666259765625" height="1422.6666259765625"/>+ <systemColor name="systemBackgroundColor">+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>+ </systemColor>+ </resources></document>diff --git a/console/iOS/GenericApp/GenericApp/ConsoleProviders/GeofenceProvider.swift b/console/iOS/GenericApp/GenericApp/ConsoleProviders/GeofenceProvider.swiftnew file mode 100644index 000000000..3d155de43--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/ConsoleProviders/GeofenceProvider.swift@@ -0,0 +1,339 @@+import UIKit+import CoreLocation++public class GeofenceProvider: NSObject, URLSessionDelegate {++ static let baseUrlKey = "baseUrl"+ static let consoleIdKey = "consoleId"+ static let geoPostUrlsKey = "geoPostUrls"+ static let geoDisabledKey = "geoDisabled"++ let version = "ORConsole"+ let geofenceFetchEndpoint = "rules/geofences/"+ let locationManager = CLLocationManager()+ let userdefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement)+ var geoPostUrls = [String:[String]]()+ var enableCallback : (([String: Any]) -> (Void))?+ var getLocationCallback : (([String: Any]) -> (Void))?++ public var baseURL: String = ""+ public var consoleId: String = ""++ private var enteredLocation: (String, [String : Any]?)? = nil+ private var exitedLocation: (String, [String : Any]?)? = nil+ private var sendQueued = false++ public override init() {+ super.init()+ locationManager.delegate = self+ locationManager.allowsBackgroundLocationUpdates = true+ locationManager.pausesLocationUpdatesAutomatically = false+ locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters+ self.baseURL = userdefaults?.string(forKey: GeofenceProvider.baseUrlKey) ?? ""+ self.consoleId = userdefaults?.string(forKey: GeofenceProvider.consoleIdKey) ?? ""+ self.geoPostUrls = userdefaults?.value(forKey: GeofenceProvider.geoPostUrlsKey) as? [String:[String]] ?? [String:[String]]()+ }++ public func initialize() -> [String: Any] {+ return [+ DefaultsKey.actionKey: Actions.providerInit,+ DefaultsKey.providerKey: Providers.geofence,+ DefaultsKey.versionKey: version,+ DefaultsKey.requiresPermissionKey: true,+ DefaultsKey.hasPermissionKey: checkPermission(),+ DefaultsKey.successKey: true,+ DefaultsKey.enabledKey: false,+ DefaultsKey.disabledKey: userdefaults?.bool(forKey: GeofenceProvider.geoDisabledKey) ?? false+ ]+ }++ private func checkPermission() -> Bool {+ if CLLocationManager.locationServicesEnabled() {+ if CLLocationManager.authorizationStatus() == .authorizedAlways {+ return true+ }+ }+ return false+ }++ private func registerPermissions() {+ locationManager.requestAlwaysAuthorization()+ }++ public func addGeofence(geofence: GeofenceDefinition) {+ let region = CLCircularRegion(center: CLLocationCoordinate2DMake(geofence.lat, geofence.lng), radius: geofence.radius, identifier:geofence.id)+ locationManager.startMonitoring(for: region)+ geoPostUrls[geofence.id] = [geofence.httpMethod, geofence.url]+ userdefaults?.set(geoPostUrls, forKey: GeofenceProvider.geoPostUrlsKey)+ userdefaults?.synchronize()+ }++ public func removeGeofence(id: String) {+ for region in locationManager.monitoredRegions {+ guard let circularRegion = region as? CLCircularRegion, circularRegion.identifier == id else {continue}+ locationManager.stopMonitoring(for: circularRegion)+ geoPostUrls.removeValue(forKey: circularRegion.identifier)+ userdefaults?.set(geoPostUrls, forKey: GeofenceProvider.geoPostUrlsKey)+ userdefaults?.synchronize()+ break+ }+ }++ public func clearAllRegions() {+ for region in locationManager.monitoredRegions {+ locationManager.stopMonitoring(for: region)+ }+ geoPostUrls = [String:[String]]()+ userdefaults?.set(geoPostUrls, forKey: GeofenceProvider.geoPostUrlsKey)+ userdefaults?.synchronize()+ }++ public func enable(baseUrl: String, consoleId: String, callback:@escaping ([String: Any]) ->(Void)) {+ self.baseURL = baseUrl+ self.consoleId = consoleId+ userdefaults?.set(self.baseURL, forKey: GeofenceProvider.baseUrlKey)+ userdefaults?.set(self.consoleId, forKey: GeofenceProvider.consoleIdKey)+ userdefaults?.removeObject(forKey: GeofenceProvider.geoDisabledKey)+ userdefaults?.synchronize()+ enableCallback = callback+ if checkPermission() {+ self.locationManager.startMonitoringSignificantLocationChanges()+ enableCallback?([+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.geofence,+ DefaultsKey.hasPermissionKey: checkPermission(),+ DefaultsKey.successKey: true+ ])+ } else {+ if CLLocationManager.authorizationStatus() == .notDetermined {+ registerPermissions()+ } else {+ enableCallback?([+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.geofence,+ DefaultsKey.hasPermissionKey: false,+ DefaultsKey.successKey: true+ ])+ }+ }+ }++ public func disable()-> [String: Any] {+ locationManager.stopMonitoringSignificantLocationChanges()+ userdefaults?.set(true, forKey: GeofenceProvider.geoDisabledKey)+ userdefaults?.removeObject(forKey: GeofenceProvider.baseUrlKey)+ userdefaults?.removeObject(forKey: GeofenceProvider.consoleIdKey)+ userdefaults?.synchronize()+ return [+ DefaultsKey.actionKey: Actions.providerDisable,+ DefaultsKey.providerKey: Providers.geofence+ ]+ }++ public func getLocation(callback:@escaping ([String: Any]) -> (Void)) {+ if CLLocationManager.authorizationStatus() == .denied {+ callback([+ DefaultsKey.actionKey: Actions.getLocation,+ DefaultsKey.providerKey: Providers.geofence,+ DefaultsKey.dataKey: nil+ ])+ } else {+ getLocationCallback = callback+ locationManager.startUpdatingLocation()+ }+ }++ public func refreshGeofences() {+ fetchGeofences()+ }++ func fetchGeofences(callback: (([GeofenceDefinition]) -> ())? = nil) {+ if let tkurlRequest = URL(string: "\(baseURL)/\(geofenceFetchEndpoint)\(consoleId)") {+ let tkRequest = NSMutableURLRequest(url: tkurlRequest)+ tkRequest.httpMethod = "GET"+ let sessionConfiguration = URLSessionConfiguration.default+ let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil)+ let req = session.dataTask(with: tkRequest as URLRequest, completionHandler: { (data, response, error) in+ if (data != nil){+ guard let geofences = try? JSONDecoder().decode([GeofenceDefinition].self, from: data!) else {+ callback?([])+ return+ }+ self.clearAllRegions()+ NSLog("%@", "Geofences count: \(geofences.count)")+ print("Geofences count: \(geofences.count)")+ for geofence in geofences {+ self.addGeofence(geofence: geofence)+ }+ callback?(geofences)+ } else {+ NSLog("error %@", (error! as NSError).localizedDescription)+ let error = NSError(domain: "", code: 0, userInfo: [+ NSLocalizedDescriptionKey : NSLocalizedString("NoDataReceived", value: "Did not receive any data", comment: "")+ ])+ NSLog("%@", error)+ callback?([])+ }+ })+ req.resume()+ } else {+ callback?([])+ }+ }++ private func queueSendLocation(geofenceId: String, data:[String: Any]?) {+ synced(lock: self) {+ if let locationData = data {+ enteredLocation = (geofenceId, locationData)+ } else {+ exitedLocation = (geofenceId, nil)++ if enteredLocation?.0 == geofenceId {+ enteredLocation = nil+ }+ }++ if !sendQueued {+ sendQueued = true+ DispatchQueue.global().asyncAfter(deadline: .now() + .seconds(2)) {+ self.doSendLocation()+ }+ }+ }+ }++ private func doSendLocation() {+ synced(lock: self) {+ var success = false++ if exitedLocation != nil {+ if sendLocation(geofenceId: exitedLocation!.0, data: exitedLocation!.1) {+ exitedLocation = nil+ success = true+ }+ } else if enteredLocation != nil {+ if sendLocation(geofenceId: enteredLocation!.0, data: enteredLocation!.1) {+ enteredLocation = nil+ success = true+ }+ }++ if exitedLocation != nil || enteredLocation != nil {+ // Schedule another send+ let delay = success ? 5 : 10+ DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(delay)) {+ self.doSendLocation()+ }+ } else {+ sendQueued = false+ }+ }+ }++ private func sendLocation(geofenceId: String, data: [String : Any]?)-> Bool {+ return synced(lock: self) {+ var succes = false++ guard let urlData = geoPostUrls[geofenceId] else {+ return succes+ }+ guard let url = URL(string: "\(baseURL)\(urlData[1])") else { return succes}++ let request = NSMutableURLRequest(url: url)+ request.addValue("application/json", forHTTPHeaderField:"Content-Type");+ request.httpMethod = urlData[0]++ if (data != nil) {+ if let postBody = try? JSONSerialization.data(withJSONObject: data!, options: []) {+ request.httpBody = postBody+ }+ } else {+ request.httpBody = "null".data(using: .utf8)+ }++ let semaphore = DispatchSemaphore(value: 0)+ let sessionConfiguration = URLSessionConfiguration.default+ let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil)+ let req = session.dataTask(with: request as URLRequest, completionHandler: { (responseData, response, error) in+ if let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 204 {+ NSLog("%@", "sendLocation succeded with data: \(String(describing: data))")+ succes = true+ } else {+ NSLog("%@", "sendLocation failed")+ if let err = error as NSError? {+ NSLog("%@", err)+ }+ }+ semaphore.signal()+ })+ req.resume()+ semaphore.wait()+ return succes+ }+ }++ private func synced<T>(lock: Any, closure: () throws -> T) rethrows -> T {+ objc_sync_enter(lock)+ defer {+ objc_sync_exit(lock)+ }++ return try closure()+ }++ public class GeofenceDefinition: NSObject, Decodable {+ public var id: String = ""+ public var lat: Double = 0.0+ public var lng: Double = 0.0+ public var radius: Double = 0.0+ public var httpMethod: String = ""+ public var url: String = ""+ }+}++extension GeofenceProvider: CLLocationManagerDelegate {+ public func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {+ NSLog("%@", "Entered geofence with id: \(region.identifier)")++ guard let circularRegion = region as? CLCircularRegion else {return}++ let postData = [+ "type": "Point",+ "coordinates": [circularRegion.center.longitude, circularRegion.center.latitude]+ ] as [String : Any]++ queueSendLocation(geofenceId: circularRegion.identifier, data: postData)+ }++ public func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {+ NSLog("%@", "Exited geofence with id: \(region.identifier)")++ guard let circularRegion = region as? CLCircularRegion else {return}++ queueSendLocation(geofenceId: circularRegion.identifier, data: nil)+ }++ public func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {+ if status != .notDetermined {+ enableCallback?([+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.geofence,+ DefaultsKey.hasPermissionKey: checkPermission(),+ DefaultsKey.successKey: true+ ])+ } else if status == .authorizedAlways {+ self.locationManager.startMonitoringSignificantLocationChanges()+ }+ }++ public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {+ if let lastLocation = locations.last {+ getLocationCallback?([+ DefaultsKey.actionKey: Actions.getLocation,+ DefaultsKey.providerKey: Providers.geofence,+ DefaultsKey.dataKey: ["latitude": lastLocation.coordinate.latitude, "longitude": lastLocation.coordinate.longitude]+ ])+ locationManager.stopUpdatingLocation()+ }+ }+}diff --git a/console/iOS/GenericApp/GenericApp/ConsoleProviders/PushNotificationProvider.swift b/console/iOS/GenericApp/GenericApp/ConsoleProviders/PushNotificationProvider.swiftnew file mode 100644index 000000000..b74e71709--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/ConsoleProviders/PushNotificationProvider.swift@@ -0,0 +1,126 @@+//+// PushNotificationProvider.swift+// Eindhoven+//+// Created by Michael Rademaker on 25/05/2018.+// Copyright © 2018 OpenRemote Inc. All rights reserved.+//++import UIKit+import UserNotifications++public class PushNotificationProvider: NSObject {++ let userdefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement)+ let version = "fcm"+ public var consoleId: String = ""+ static let pushDisabledKey = "pushDisabled"++ public override init() {+ super.init()+ }++ public func initialize(callback:@escaping ([String: Any?]) ->(Void)) {+ UNUserNotificationCenter.current().getNotificationSettings { (settings) in+ switch settings.authorizationStatus {++ case .authorized, .provisional:+ callback( [+ DefaultsKey.actionKey: Actions.providerInit,+ DefaultsKey.providerKey: Providers.push,+ DefaultsKey.versionKey: self.version,+ DefaultsKey.hasPermissionKey: true,+ DefaultsKey.requiresPermissionKey: true,+ DefaultsKey.successKey: true,+ DefaultsKey.enabledKey: false,+ DefaultsKey.disabledKey: self.userdefaults?.bool(forKey: PushNotificationProvider.pushDisabledKey) ?? false+ ])++ case .denied:+ callback( [+ DefaultsKey.actionKey: Actions.providerInit,+ DefaultsKey.providerKey: Providers.push,+ DefaultsKey.versionKey: self.version,+ DefaultsKey.hasPermissionKey: false,+ DefaultsKey.requiresPermissionKey: true,+ DefaultsKey.successKey: true,+ DefaultsKey.enabledKey: false,+ DefaultsKey.disabledKey: self.userdefaults?.bool(forKey: PushNotificationProvider.pushDisabledKey) ?? false+ ])++ default:+ callback( [+ DefaultsKey.actionKey: Actions.providerInit,+ DefaultsKey.providerKey: Providers.push,+ DefaultsKey.versionKey: self.version,+ DefaultsKey.hasPermissionKey: nil,+ DefaultsKey.requiresPermissionKey: true,+ DefaultsKey.successKey: true,+ DefaultsKey.enabledKey: false,+ DefaultsKey.disabledKey: self.userdefaults?.bool(forKey: PushNotificationProvider.pushDisabledKey) ?? false+ ])+ }+ }+ }++ public func enable(consoleId: String, callback:@escaping ([String: Any]) ->(Void)) {+ self.consoleId = consoleId+ userdefaults?.set(self.consoleId, forKey: GeofenceProvider.consoleIdKey)+ userdefaults?.removeObject(forKey: PushNotificationProvider.pushDisabledKey)+ userdefaults?.synchronize()+ UNUserNotificationCenter.current().getNotificationSettings { (settings) in++ switch settings.authorizationStatus {+ case .authorized, .provisional:+ DispatchQueue.main.async {+ UIApplication.shared.registerForRemoteNotifications()+ }+ callback([+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.push,+ DefaultsKey.hasPermissionKey: true,+ DefaultsKey.successKey: true,+ DefaultsKey.dataKey: ["token": self.userdefaults?.string(forKey: DefaultsKey.fcmTokenKey)]+ ])++ case .denied:+ callback([+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.push,+ DefaultsKey.hasPermissionKey: false,+ DefaultsKey.successKey: true,+ DefaultsKey.dataKey: ["token": self.userdefaults?.string(forKey: DefaultsKey.fcmTokenKey)]+ ])++ default:+ UNUserNotificationCenter.current().requestAuthorization(+ options: [.alert, .badge, .sound],+ completionHandler: {granted, _ in+ if granted {+ DispatchQueue.main.async {+ UIApplication.shared.registerForRemoteNotifications()+ }+ }++ callback([+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.push,+ DefaultsKey.hasPermissionKey: granted,+ DefaultsKey.successKey: true,+ DefaultsKey.dataKey: ["token": self.userdefaults?.string(forKey: DefaultsKey.fcmTokenKey)]+ ])+ })++ }+ }+ }++ public func disable()-> [String: Any] {+ userdefaults?.set(true, forKey: PushNotificationProvider.pushDisabledKey)+ userdefaults?.synchronize()+ return [+ DefaultsKey.actionKey: Actions.providerDisable,+ DefaultsKey.providerKey: Providers.push+ ]+ }+}diff --git a/console/iOS/GenericApp/GenericApp/ConsoleProviders/StorageProvider.swift b/console/iOS/GenericApp/GenericApp/ConsoleProviders/StorageProvider.swiftnew file mode 100644index 000000000..0502e4d08--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/ConsoleProviders/StorageProvider.swift@@ -0,0 +1,59 @@+//+// StorageProvider.swift+// GoogleToolboxForMac+//+// Created by Michael Rademaker on 05/02/2019.+//++import UIKit++class StorageProvider: NSObject {++ let userdefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement)++ public func initialize() -> [String: Any] {+ return [+ DefaultsKey.actionKey: Actions.providerInit,+ DefaultsKey.providerKey: Providers.storage,+ DefaultsKey.versionKey: "1.0.0",+ DefaultsKey.requiresPermissionKey: false,+ DefaultsKey.hasPermissionKey: true,+ DefaultsKey.successKey: true,+ DefaultsKey.enabledKey: true+ ]+ }++ public func enable() -> [String: Any] {+ return [+ DefaultsKey.actionKey: Actions.providerEnable,+ DefaultsKey.providerKey: Providers.storage,+ DefaultsKey.hasPermissionKey: true,+ DefaultsKey.successKey: true,+ ]+ }++ public func store(key: String, data: String?) {+ if let dataToStore = data {+ userdefaults?.set(dataToStore, forKey: key)+ } else {+ userdefaults?.removeObject(forKey: key)+ }+ userdefaults?.synchronize()+ }++ public func retrieve(key: String) -> [String: Any] {+ return [+ DefaultsKey.actionKey: Actions.retrieve,+ DefaultsKey.providerKey: Providers.storage,+ "key": key,+ "value": userdefaults?.string(forKey:key) ?? "null"+ ]+ }++ public func disable()-> [String: Any] {+ return [+ DefaultsKey.actionKey: Actions.providerDisable,+ DefaultsKey.providerKey: Providers.storage+ ]+ }+}diff --git a/console/iOS/GenericApp/GenericApp/ContentView.swift b/console/iOS/GenericApp/GenericApp/ContentView.swiftdeleted file mode 100644index 4d41117d9..000000000--- a/console/iOS/GenericApp/GenericApp/ContentView.swift+++ /dev/null@@ -1,21 +0,0 @@-//-// ContentView.swift-// GenericApp-//-// Created by nuc on 17/06/2020.-// Copyright © 2020 OpenRemote. All rights reserved.-//--import SwiftUI--struct ContentView: View {- var body: some View {- Text("Hello, World!")- }-}--struct ContentView_Previews: PreviewProvider {- static var previews: some View {- ContentView()- }-}diff --git a/console/iOS/GenericApp/GenericApp/Info.plist b/console/iOS/GenericApp/GenericApp/Info.plistindex 9742bf0f4..fca202f5b 100644--- a/console/iOS/GenericApp/GenericApp/Info.plist+++ b/console/iOS/GenericApp/GenericApp/Info.plist@@ -15,30 +15,41 @@<key>CFBundlePackageType</key><string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string><key>CFBundleShortVersionString</key>- <string>1.0</string>+ <string>$(MARKETING_VERSION)</string><key>CFBundleVersion</key>- <string>1</string>+ <string>$(CURRENT_PROJECT_VERSION)</string>+ <key>LSApplicationCategoryType</key>+ <string></string><key>LSRequiresIPhoneOS</key><true/>- <key>UIApplicationSceneManifest</key>- <dict>- <key>UIApplicationSupportsMultipleScenes</key>- <false/>- <key>UISceneConfigurations</key>+ <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>+ <string>Location is needed in order to get updates on surveys</string>+ <key>NSLocationAlwaysUsageDescription</key>+ <string>Location is needed in order to get updates on surveys</string>+ <key>NSLocationUsageDescription</key>+ <string>Location is needed in order to get updates on surveys</string>+ <key>NSLocationWhenInUseUsageDescription</key>+ <string>Location is needed in order to get updates on surveys</string>+ <key>UIApplicationShortcutItems</key>+ <array><dict>- <key>UIWindowSceneSessionRoleApplication</key>- <array>- <dict>- <key>UISceneConfigurationName</key>- <string>Default Configuration</string>- <key>UISceneDelegateClassName</key>- <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>- </dict>- </array>+ <key>UIApplicationShortcutItemIconFile</key>+ <string>ic_settings</string>+ <key>UIApplicationShortcutItemTitle</key>+ <string>Projects</string>+ <key>UIApplicationShortcutItemType</key>+ <string>projects</string></dict>- </dict>+ </array>+ <key>UIBackgroundModes</key>+ <array>+ <string>location</string>+ <string>remote-notification</string>+ </array><key>UILaunchStoryboardName</key><string>LaunchScreen</string>+ <key>UIMainStoryboardFile</key>+ <string>Storyboard</string><key>UIRequiredDeviceCapabilities</key><array><string>armv7</string>@@ -46,8 +57,6 @@<key>UISupportedInterfaceOrientations</key><array><string>UIInterfaceOrientationPortrait</string>- <string>UIInterfaceOrientationLandscapeLeft</string>- <string>UIInterfaceOrientationLandscapeRight</string></array><key>UISupportedInterfaceOrientations~ipad</key><array>diff --git a/console/iOS/GenericApp/GenericApp/Models/ORAppConfig.swift b/console/iOS/GenericApp/GenericApp/Models/ORAppConfig.swiftnew file mode 100644index 000000000..0c6ddcbb1--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Models/ORAppConfig.swift@@ -0,0 +1,22 @@+//+// ORAppConfig.swift+// GenericApp+//+// Created by Michael Rademaker on 21/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import UIKit++struct ORAppConfig: Codable {+ let id: Int32+ let realm: String+ let initialUrl: String+ let url: String+ let menuEnabled: Bool+ let menuPosition: String?+ let menuImage: String?+ let primaryColor: String?+ let secondaryColor: String?+ let links: [ORLinkConfig]?+}diff --git a/console/iOS/GenericApp/GenericApp/Models/ORLinkConfig.swift b/console/iOS/GenericApp/GenericApp/Models/ORLinkConfig.swiftnew file mode 100644index 000000000..ed2469298--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Models/ORLinkConfig.swift@@ -0,0 +1,14 @@+//+// ORLinkConfig.swift+// GenericApp+//+// Created by Michael Rademaker on 21/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import UIKit++struct ORLinkConfig: Codable {+ let displayText: String+ let pageLink: String+}diff --git a/console/iOS/GenericApp/GenericApp/Models/ORPushNotificationAction.swift b/console/iOS/GenericApp/GenericApp/Models/ORPushNotificationAction.swiftnew file mode 100644index 000000000..9b727f230--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Models/ORPushNotificationAction.swift@@ -0,0 +1,16 @@+//+// ORPushNotificationAction.swift+// ORLib+//+// Created by Michael Rademaker on 01/08/2018.+//++import UIKit++public struct ORPushNotificationAction: Codable {+ public let url: String+ public let httpMethod: String?+ public let data: String?+ public let silent: Bool+ public let openInBrowser: Bool+}diff --git a/console/iOS/GenericApp/GenericApp/Models/ORPushNotificationButton.swift b/console/iOS/GenericApp/GenericApp/Models/ORPushNotificationButton.swiftnew file mode 100644index 000000000..30d50f8a6--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Models/ORPushNotificationButton.swift@@ -0,0 +1,13 @@+//+// ORPushNotificationButton.swift+// ORLib+//+// Created by Michael Rademaker on 07/08/2018.+//++import UIKit++public struct ORPushNotificationButton: Codable {+ public let title: String+ public let action: ORPushNotificationAction?+}diff --git a/console/iOS/GenericApp/GenericApp/Network/ApiManager.swift b/console/iOS/GenericApp/GenericApp/Network/ApiManager.swiftnew file mode 100644index 000000000..e8efe6832--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Network/ApiManager.swift@@ -0,0 +1,158 @@+//+// ApiManager.swift+// GenericApp+//+// Created by nuc on 17/06/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import UIKit++typealias ResponseBlock<T: Codable> = (_ statusCode: Int, _ object: T?, _ error: Error?) -> ()++enum HttpMethod: String {+ case get = "GET"+ case post = "POST"+ case put = "PUT"+ case delete = "DELETE"+ case batch = "BATCH"+}++class ApiManager: NSObject {++ private let baseUrl: URL;++ init(baseUrl: String) {+ self.baseUrl = URL(string: baseUrl)!+ super.init()+ }++ static var accessToken: String?++ let session: URLSession = {+ let config = URLSessionConfiguration.default+ config.httpAdditionalHeaders = ["Content-Type": "application/json", "Accept": "application/json"]+ return URLSession(configuration: config)+ }()++ let encoder: JSONEncoder = {+ let encoder = JSONEncoder()+ encoder.keyEncodingStrategy = .convertToSnakeCase+ return encoder+ }()++ let decoder: JSONDecoder = {+ let decoder = JSONDecoder()+ decoder.keyDecodingStrategy = .convertFromSnakeCase+ return decoder+ }()++ func getAppConfig(callback: ResponseBlock<ORAppConfig>?) {+ self.get(pathComponents: ["app", "config"], callback: callback)+ }++ //REST METHODS+ private func createRequest(method: HttpMethod, pathComponents:[String], queryParameters: [String: Any]? = nil) -> URLRequest {+ var url: URL+ if let urlParameters = queryParameters, var components = URLComponents(url: baseUrl, resolvingAgainstBaseURL: false) {+ components.queryItems = urlParameters.map {+ URLQueryItem(name: $0, value: String(describing: $1))+ }+ url = components.url!+ } else {+ url = baseUrl+ }++ for pathComponent in pathComponents {+ url = url.appendingPathComponent(pathComponent)+ }++ var urlRequest = URLRequest(url: url)+ urlRequest.httpMethod = method.rawValue++ if let accessToken = ApiManager.accessToken {+ urlRequest.addValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")+ }++ return urlRequest+ }++ private func get<T: Decodable>(pathComponents: [String], queryParameters: [String: Any]? = nil, callback: ResponseBlock<T>?) {+ let urlRequest = self.createRequest(method: .get, pathComponents: pathComponents, queryParameters: queryParameters)++ session.dataTask(with: urlRequest, completionHandler: { responseData, response, error in+ let httpStatusCode = (response as? HTTPURLResponse)?.statusCode ?? 500++ guard let responseData = responseData else {+ callback?(httpStatusCode, nil, error);+ return+ }++ guard let responseModel = try? self.decoder.decode(T.self, from: responseData) else {+ print("Couldn't parse response: \(String(data: responseData, encoding: .utf8)!)")+ callback?(httpStatusCode, nil, error);+ return;+ }++ callback?(httpStatusCode, responseModel, nil)+ }).resume()+ }++ private func put<T : Encodable, R : Decodable> (pathComponents:[String], item:T, callback: ResponseBlock<R>?) {+ let urlRequest = createRequest(method: .put, pathComponents: pathComponents)++ guard let data = try? encoder.encode(item) else {+ callback?(500, nil , nil)+ return+ }++ session.uploadTask(with: urlRequest, from: data, completionHandler: { responseData, response, error in+ let httpStatusCode = (response as? HTTPURLResponse)?.statusCode ?? 500++ guard let responseData = responseData else {+ callback?(httpStatusCode, nil, error);+ return+ }++ guard let responseModel = try? self.decoder.decode(R.self, from: responseData) else {+ print("Couldn't parse response: \(String(data: responseData, encoding: .utf8)!)")+ callback?(httpStatusCode, nil, error);+ return;+ }++ callback?(httpStatusCode, responseModel, nil)+ }).resume()+ }++ private func post<T : Encodable, R : Decodable> (pathComponents:[String], item:T, callback: ResponseBlock<R>?) {+ let urlRequest = createRequest(method: .post, pathComponents: pathComponents)++ guard let data = try? encoder.encode(item) else {+ callback?(500, nil , nil)+ return+ }++ session.uploadTask(with: urlRequest, from: data, completionHandler: { responseData, response, error in+ let httpStatusCode = (response as? HTTPURLResponse)?.statusCode ?? 500++ guard let responseData = responseData else {+ callback?(httpStatusCode, nil, error);+ return+ }+//+// do {+// try self.decoder.decode(R.self, from: responseData)+// } catch let err {+// print(err)+// }++ guard let responseModel = try? self.decoder.decode(R.self, from: responseData) else {+ print("Couldn't parse response: \(String(data: responseData, encoding: .utf8)!)")+ callback?(httpStatusCode, nil, error);+ return;+ }++ callback?(httpStatusCode, responseModel, nil)+ }).resume()+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Network/ORNotificationResource.swift b/console/iOS/GenericApp/GenericApp/Network/ORNotificationResource.swiftnew file mode 100644index 000000000..d81e9ec3e--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Network/ORNotificationResource.swift@@ -0,0 +1,70 @@+//+// ORNotificationResource.swift+// ORLib+//+// Created by Michael Rademaker on 08/08/2018.+//++import UIKit++public class ORNotificationResource: NSObject, URLSessionDelegate {++ public static let sharedInstance = ORNotificationResource()++ private override init() {+ super.init()+ }++ public func notificationDelivered(notificationId : Int64, targetId : String) {+ if let userdefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement),+ let project = userdefaults.string(forKey: DefaultsKey.projectKey),+ let realm = userdefaults.string(forKey: DefaultsKey.realmKey) {+ guard let urlRequest = URL(string: "https://\(project).openremote.io/\(realm)/notification/\(notificationId)/delivered?targetId=\(targetId)") else { return }+ let request = NSMutableURLRequest(url: urlRequest)+ request.httpMethod = "PUT"+ let sessionConfiguration = URLSessionConfiguration.default+ let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue : nil)+ let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in+ DispatchQueue.main.async {+ if (error != nil) {+ NSLog("error %@", (error! as NSError).localizedDescription)+ let error = NSError(domain: "", code: 0, userInfo: [+ NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")+ ])+ print(error)+ }+ }+ })+ reqDataTask.resume()+ }+ }++ public func notificationAcknowledged(notificationId : Int64, targetId : String, acknowledgement: String) {+ if let userdefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement),+ let project = userdefaults.string(forKey: DefaultsKey.projectKey),+ let realm = userdefaults.string(forKey: DefaultsKey.realmKey) {+ guard let urlRequest = URL(string: "https://\(project).openremote.io/\(realm)/notification/\(notificationId)/acknowledged?targetId=\(targetId)") else { return }+ let request = NSMutableURLRequest(url: urlRequest)+ request.httpMethod = "PUT"++ if let json = try? JSONSerialization.data(withJSONObject: ["acknowledgement": acknowledgement], options: []) {+ request.addValue("application/json", forHTTPHeaderField: "Content-Type")+ request.httpBody = json+ }+ let sessionConfiguration = URLSessionConfiguration.default+ let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue : nil)+ let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in+ DispatchQueue.main.async {+ if (error != nil) {+ NSLog("error %@", (error! as NSError).localizedDescription)+ let error = NSError(domain: "", code: 0, userInfo: [+ NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")+ ])+ print(error)+ }+ }+ })+ reqDataTask.resume()+ }+ }+}diff --git a/console/iOS/GenericApp/GenericApp/OpenRemote.entitlements b/console/iOS/GenericApp/GenericApp/OpenRemote.entitlementsnew file mode 100644index 000000000..e69de29bbdiff --git a/console/iOS/GenericApp/GenericApp/SceneDelegate.swift b/console/iOS/GenericApp/GenericApp/SceneDelegate.swiftdeleted file mode 100644index 857c68ad7..000000000--- a/console/iOS/GenericApp/GenericApp/SceneDelegate.swift+++ /dev/null@@ -1,64 +0,0 @@-//-// SceneDelegate.swift-// GenericApp-//-// Created by nuc on 17/06/2020.-// Copyright © 2020 OpenRemote. All rights reserved.-//--import UIKit-import SwiftUI--class SceneDelegate: UIResponder, UIWindowSceneDelegate {-- var window: UIWindow?--- func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {- // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.- // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.- // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).-- // Create the SwiftUI view that provides the window contents.- let contentView = ContentView()-- // Use a UIHostingController as window root view controller.- if let windowScene = scene as? UIWindowScene {- let window = UIWindow(windowScene: windowScene)- window.rootViewController = UIHostingController(rootView: contentView)- self.window = window- window.makeKeyAndVisible()- }- }-- func sceneDidDisconnect(_ scene: UIScene) {- // Called as the scene is being released by the system.- // This occurs shortly after the scene enters the background, or when its session is discarded.- // Release any resources associated with this scene that can be re-created the next time the scene connects.- // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).- }-- func sceneDidBecomeActive(_ scene: UIScene) {- // Called when the scene has moved from an inactive state to an active state.- // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.- }-- func sceneWillResignActive(_ scene: UIScene) {- // Called when the scene will move from an active state to an inactive state.- // This may occur due to temporary interruptions (ex. an incoming phone call).- }-- func sceneWillEnterForeground(_ scene: UIScene) {- // Called as the scene transitions from the background to the foreground.- // Use this method to undo the changes made on entering the background.- }-- func sceneDidEnterBackground(_ scene: UIScene) {- // Called as the scene transitions from the foreground to the background.- // Use this method to save data, release shared resources, and store enough scene-specific state information- // to restore the scene back to its current state.- }---}-diff --git a/console/iOS/GenericApp/GenericApp/Storyboard.storyboard b/console/iOS/GenericApp/GenericApp/Storyboard.storyboardnew file mode 100644index 000000000..d983bb0c5--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Storyboard.storyboard@@ -0,0 +1,149 @@+<?xml version="1.0" encoding="UTF-8"?>+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="oDU-zF-Uvs">+ <device id="retina6_1" orientation="portrait" appearance="light"/>+ <dependencies>+ <deployment identifier="iOS"/>+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>+ <capability name="System colors in document resources" minToolsVersion="11.0"/>+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>+ </dependencies>+ <scenes>+ <!--Splash View Controller-->+ <scene sceneID="xjs-uN-Dtd">+ <objects>+ <viewController id="oDU-zF-Uvs" customClass="SplashViewController" customModule="OpenRemote" customModuleProvider="target" sceneMemberID="viewController">+ <view key="view" contentMode="scaleToFill" id="bwX-tc-a4T">+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>+ <subviews>+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="or_splash" translatesAutoresizingMaskIntoConstraints="NO" id="vrO-P7-2kF">+ <rect key="frame" x="87" y="328" width="240" height="240"/>+ <constraints>+ <constraint firstAttribute="height" constant="240" id="pYh-GS-ffl"/>+ <constraint firstAttribute="width" constant="240" id="uwp-Jw-jfU"/>+ </constraints>+ </imageView>+ </subviews>+ <viewLayoutGuide key="safeArea" id="y8x-w5-OSh"/>+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>+ <constraints>+ <constraint firstItem="vrO-P7-2kF" firstAttribute="centerX" secondItem="bwX-tc-a4T" secondAttribute="centerX" id="3wG-g6-lNC"/>+ <constraint firstItem="vrO-P7-2kF" firstAttribute="centerY" secondItem="bwX-tc-a4T" secondAttribute="centerY" id="hI3-hf-7JJ"/>+ </constraints>+ </view>+ <connections>+ <segue destination="i2l-kx-xKH" kind="presentation" identifier="goToProjectView" modalPresentationStyle="fullScreen" id="PNL-Mf-RkC"/>+ <segue destination="HSA-l5-YFF" kind="presentation" identifier="goToWebView" modalPresentationStyle="fullScreen" id="5Oq-tw-rj7"/>+ </connections>+ </viewController>+ <placeholder placeholderIdentifier="IBFirstResponder" id="Afh-RU-OvJ" userLabel="First Responder" sceneMemberID="firstResponder"/>+ </objects>+ <point key="canvasLocation" x="53" y="375"/>+ </scene>+ <!--Project View Controller-->+ <scene sceneID="VQ6-6b-t86">+ <objects>+ <viewController id="i2l-kx-xKH" customClass="ProjectViewController" customModule="OpenRemote" customModuleProvider="target" sceneMemberID="viewController">+ <view key="view" contentMode="scaleToFill" id="YE9-2c-hEL">+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>+ <subviews>+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="or_logo" translatesAutoresizingMaskIntoConstraints="NO" id="91w-Qy-cB6">+ <rect key="frame" x="30" y="124" width="354" height="199"/>+ <constraints>+ <constraint firstAttribute="width" secondItem="91w-Qy-cB6" secondAttribute="height" multiplier="16:9" id="bHR-kc-LYU"/>+ </constraints>+ </imageView>+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Connect to your application" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kbv-Tf-5fK">+ <rect key="frame" x="30" y="383" width="354" height="21"/>+ <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>+ <nil key="textColor"/>+ <nil key="highlightedColor"/>+ </label>+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BlP-aM-prv" customClass="ORTextInput" customModule="OpenRemote" customModuleProvider="target">+ <rect key="frame" x="30" y="423" width="354" height="40"/>+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>+ <constraints>+ <constraint firstAttribute="height" constant="40" id="nJi-N3-4Su"/>+ </constraints>+ <userDefinedRuntimeAttributes>+ <userDefinedRuntimeAttribute type="string" keyPath="setPlaceholderText" value="Project"/>+ </userDefinedRuntimeAttributes>+ </view>+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2fd-Z9-umb" customClass="ORTextInput" customModule="OpenRemote" customModuleProvider="target">+ <rect key="frame" x="30" y="503" width="354" height="40"/>+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>+ <constraints>+ <constraint firstAttribute="height" constant="40" id="Ddc-Hy-G6Q"/>+ </constraints>+ <userDefinedRuntimeAttributes>+ <userDefinedRuntimeAttribute type="string" keyPath="setPlaceholderText" value="Realm"/>+ </userDefinedRuntimeAttributes>+ </view>+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tdG-Qt-Lhh" customClass="MDCRaisedButton">+ <rect key="frame" x="325" y="623" width="59" height="30"/>+ <state key="normal" title="Connect"/>+ <connections>+ <action selector="connectButtonpressed:" destination="i2l-kx-xKH" eventType="touchUpInside" id="x7E-CE-Jfr"/>+ </connections>+ </button>+ </subviews>+ <viewLayoutGuide key="safeArea" id="D5Z-HK-RNC"/>+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>+ <constraints>+ <constraint firstItem="tdG-Qt-Lhh" firstAttribute="trailing" secondItem="2fd-Z9-umb" secondAttribute="trailing" id="2el-oM-gye"/>+ <constraint firstItem="D5Z-HK-RNC" firstAttribute="trailing" secondItem="Kbv-Tf-5fK" secondAttribute="trailing" constant="30" id="2jL-yL-nzr"/>+ <constraint firstItem="91w-Qy-cB6" firstAttribute="trailing" secondItem="Kbv-Tf-5fK" secondAttribute="trailing" id="4JQ-ny-GpV"/>+ <constraint firstItem="Kbv-Tf-5fK" firstAttribute="top" secondItem="91w-Qy-cB6" secondAttribute="bottom" constant="60" id="6Xz-rs-f9s"/>+ <constraint firstItem="tdG-Qt-Lhh" firstAttribute="top" secondItem="2fd-Z9-umb" secondAttribute="bottom" constant="80" id="8YO-LN-Y6a"/>+ <constraint firstItem="BlP-aM-prv" firstAttribute="leading" secondItem="Kbv-Tf-5fK" secondAttribute="leading" id="EHO-FA-FcK"/>+ <constraint firstItem="91w-Qy-cB6" firstAttribute="leading" secondItem="Kbv-Tf-5fK" secondAttribute="leading" id="LwD-ts-QIa"/>+ <constraint firstItem="BlP-aM-prv" firstAttribute="top" secondItem="Kbv-Tf-5fK" secondAttribute="bottom" constant="19" id="fEU-7e-c4r"/>+ <constraint firstItem="Kbv-Tf-5fK" firstAttribute="leading" secondItem="D5Z-HK-RNC" secondAttribute="leading" constant="30" id="kBY-W2-5la"/>+ <constraint firstItem="2fd-Z9-umb" firstAttribute="leading" secondItem="BlP-aM-prv" secondAttribute="leading" id="khz-Ar-gHc"/>+ <constraint firstItem="91w-Qy-cB6" firstAttribute="top" secondItem="D5Z-HK-RNC" secondAttribute="top" constant="80" id="mPB-1f-dRx"/>+ <constraint firstItem="2fd-Z9-umb" firstAttribute="top" secondItem="BlP-aM-prv" secondAttribute="bottom" constant="40" id="ptV-cK-szI"/>+ <constraint firstItem="BlP-aM-prv" firstAttribute="trailing" secondItem="Kbv-Tf-5fK" secondAttribute="trailing" id="rBu-cB-S9o"/>+ <constraint firstItem="2fd-Z9-umb" firstAttribute="trailing" secondItem="BlP-aM-prv" secondAttribute="trailing" id="zdw-wG-TuZ"/>+ </constraints>+ </view>+ <connections>+ <outlet property="connectButton" destination="tdG-Qt-Lhh" id="XHn-UJ-kYr"/>+ <outlet property="projectTextInput" destination="BlP-aM-prv" id="CXN-GZ-wnr"/>+ <outlet property="realmTextInput" destination="2fd-Z9-umb" id="WBg-9f-mUS"/>+ <segue destination="HSA-l5-YFF" kind="presentation" identifier="goToWebView" modalPresentationStyle="fullScreen" id="DyD-E7-g7I"/>+ </connections>+ </viewController>+ <placeholder placeholderIdentifier="IBFirstResponder" id="n9R-ku-sNp" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>+ </objects>+ <point key="canvasLocation" x="849" y="61"/>+ </scene>+ <!--Viewcontroller-->+ <scene sceneID="liA-xA-sIe">+ <objects>+ <viewController id="HSA-l5-YFF" customClass="ORViewcontroller" customModule="OpenRemote" customModuleProvider="target" sceneMemberID="viewController">+ <view key="view" contentMode="scaleToFill" id="iMh-t6-rOs">+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>+ <viewLayoutGuide key="safeArea" id="eSh-1f-zrb"/>+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>+ </view>+ <navigationItem key="navigationItem" id="kjP-Jz-yAy"/>+ </viewController>+ <placeholder placeholderIdentifier="IBFirstResponder" id="06P-nW-O1T" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>+ </objects>+ <point key="canvasLocation" x="848" y="745"/>+ </scene>+ </scenes>+ <inferredMetricsTieBreakers>+ <segue reference="DyD-E7-g7I"/>+ </inferredMetricsTieBreakers>+ <resources>+ <image name="or_logo" width="1422.6666259765625" height="806.33331298828125"/>+ <image name="or_splash" width="1422.6666259765625" height="1422.6666259765625"/>+ <systemColor name="systemBackgroundColor">+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>+ </systemColor>+ </resources>+</document>diff --git a/console/iOS/GenericApp/GenericApp/UI/ErrorManager.swift b/console/iOS/GenericApp/GenericApp/UI/ErrorManager.swiftnew file mode 100644index 000000000..64cedbf13--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/UI/ErrorManager.swift@@ -0,0 +1,45 @@+/*+ * Copyright 2017, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */++import Foundation+import UIKit++public class ErrorManager : NSObject {++ static func showError(error : Error) {+ DispatchQueue.main.async {+ NSLog("showing error %@",error as NSError)+ let topWindow = UIWindow(frame: UIScreen.main.bounds)+ topWindow.rootViewController = UIViewController()+ topWindow.windowLevel = UIWindow.Level.alert + 1+ let alertVC = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: UIAlertController.Style.alert)+ let alertAction = UIAlertAction(title: "Done", style: .cancel) { (action) in+ topWindow.rootViewController?.presentedViewController?.dismiss(animated: true, completion: nil)+ topWindow.isHidden = true+ }++ alertVC.addAction(alertAction)+ DispatchQueue.main.async {+ topWindow.makeKeyAndVisible()+ topWindow.rootViewController?.present(alertVC, animated: true, completion: nil)+ }+ }+ }+}diff --git a/console/iOS/GenericApp/GenericApp/UI/LoginView.swift b/console/iOS/GenericApp/GenericApp/UI/LoginView.swiftdeleted file mode 100644index 215b8a873..000000000--- a/console/iOS/GenericApp/GenericApp/UI/LoginView.swift+++ /dev/null@@ -1,52 +0,0 @@-//-// LoginView.swift-// GenericApp-//-// Created by nuc on 17/06/2020.-// Copyright © 2020 OpenRemote. All rights reserved.-//--import SwiftUI--struct LoginView: View {- @State private var realm: String = ""-- var body: some View {- VStack{- Image("logo").resizable().aspectRatio(contentMode: .fit)- Text("Connect to your application")- .font(.title)- TextField("Project", text: $realm)- .font(.title)- .padding()- .background(Color.gray)- .cornerRadius(10)- .padding()- TextField("Realm", text: $realm)- .font(.title)- .padding()- .background(Color.gray)- .cornerRadius(10)- .padding()- HStack {- Spacer()- Button(action: {- print("Hey")- }, label: {- Text("Connect")- })- .foregroundColor(Color.white)- .padding()- .background(Color.green)- .cornerRadius(10)- .padding()- }- }- }-}--struct LoginView_Previews: PreviewProvider {- static var previews: some View {- LoginView()- }-}diff --git a/console/iOS/GenericApp/GenericApp/UI/ORTextInput.swift b/console/iOS/GenericApp/GenericApp/UI/ORTextInput.swiftnew file mode 100644index 000000000..cd78799a6--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/UI/ORTextInput.swift@@ -0,0 +1,69 @@+//+// ORTextInput.swift+// GenericApp+//+// Created by Michael Rademaker on 26/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import UIKit+import MaterialComponents.MaterialTextFields++@IBDesignable // Lets you change a UIView instance in storyboard to this class, so you can visualize it and add constraints to it+class ORTextInput: UIView {++ private var textInput: MDCTextField!+ private var controller: MDCTextInputControllerFilled!+ private let textColor = UIColor(named: "or_green")++ private var placeholderText = ""++ @IBInspectable var setPlaceholderText: String {+ get {+ return placeholderText+ }+ set(str) {+ placeholderText = str+ }+ }++ var textField: UITextField? {+ get {+ return textInput+ }+ }++ override func layoutSubviews() {+ setupInputView()+ setupContoller()+ }++ private func setupInputView(){+ if let _ = self.viewWithTag(1){return}++ textInput = MDCTextField()+ textInput.tag = 1+ textInput.translatesAutoresizingMaskIntoConstraints = false+ textInput.placeholder = placeholderText+ textInput.textColor = textColor++ self.addSubview(textInput)++ NSLayoutConstraint.activate([+ (textInput.topAnchor.constraint(equalTo: self.topAnchor)),+ (textInput.bottomAnchor.constraint(equalTo: self.bottomAnchor)),+ (textInput.leadingAnchor.constraint(equalTo: self.leadingAnchor)),+ (textInput.trailingAnchor.constraint(equalTo: self.trailingAnchor))+ ])+++ }++ private func setupContoller(){+ controller = MDCTextInputControllerFilled(textInput: textInput)++ controller.activeColor = textColor+ controller.textInput?.textColor = textColor+ controller.floatingPlaceholderActiveColor = textColor+ }+}diff --git a/console/iOS/GenericApp/GenericApp/UI/ORViewController.swift b/console/iOS/GenericApp/GenericApp/UI/ORViewController.swiftnew file mode 100644index 000000000..50284490c--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/UI/ORViewController.swift@@ -0,0 +1,446 @@+/*+ * Copyright 2017, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */++import Foundation+import UIKit+import WebKit+import MaterialComponents.MaterialButtons+import Popover++class ORViewcontroller : UIViewController {++ var data : Data?+ var menuButton: MDCFloatingButton?+ var menuList: UIView?+ var myWebView : WKWebView?+ var webProgressBar: UIProgressView?+ var defaults : UserDefaults?+ var webCfg : WKWebViewConfiguration?+ var appConfig: ORAppConfig?+ var popover: Popover?+ var geofenceProvider: GeofenceProvider?+ var pushProvider: PushNotificationProvider?+ var storageProvider: StorageProvider?++ var popoverOptions: [PopoverOption]?++ override func viewDidLoad() {+ super.viewDidLoad()+ view.backgroundColor = UIColor.white+ }++ override func viewWillAppear(_ animated: Bool) {+ super.viewWillAppear(animated)+ self.configureAccess()+ }++ override func viewDidAppear(_ animated: Bool) {+ super.viewDidAppear(animated)+ if let applicationConfig = appConfig {+ myWebView?.load(URLRequest(url: URL(string: applicationConfig.initialUrl.stringByURLEncoding()!)!))+ }+ }++ func sendData(data: [String: Any?]) {+ if let theJSONData = try? JSONSerialization.data(+ withJSONObject: data,+ options: []) {+ let theJSONText = String(data: theJSONData,+ encoding: .utf8)+ let returnMessage = "OpenRemoteConsole._handleProviderResponse('\(theJSONText ?? "null")')"+ DispatchQueue.main.async {+ self.myWebView?.evaluateJavaScript("\(returnMessage)", completionHandler: { (any, error) in+ print("JSON string = \(theJSONText!)")+ })+ }+ }+ }++ func configureAccess() {+ let webCfg:WKWebViewConfiguration = WKWebViewConfiguration()+ let userController:WKUserContentController = WKUserContentController()++ userController.add(self, name: "int")++ let exec_template : String? = ""+ let userScript:WKUserScript = WKUserScript(source: exec_template!, injectionTime: .atDocumentStart, forMainFrameOnly: true)+ userController.addUserScript(userScript)++ webCfg.userContentController = userController;+ let sbHeight: CGFloat+ if #available(iOS 11.0, *) {+ sbHeight = UIApplication.shared.keyWindow?.safeAreaInsets.top ?? UIApplication.shared.statusBarFrame.height+ } else {+ sbHeight = UIApplication.shared.statusBarFrame.height+ }+ let webFrame = CGRect(x: 0, y: sbHeight, width: view.frame.size.width, height: view.frame.size.height - sbHeight)+ myWebView = WKWebView(frame: webFrame, configuration: webCfg)+ myWebView?.autoresizingMask = [.flexibleWidth, .flexibleHeight];+ myWebView?.navigationDelegate = self;+ //add observer to get estimated progress value+ myWebView?.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil);++ webProgressBar = UIProgressView(progressViewStyle: .bar)+ webProgressBar?.progressTintColor = UIColor(named: "or_green")++ view.addSubview(myWebView!)+ view.addSubview(webProgressBar!)+ view.bringSubviewToFront(webProgressBar!)++ webProgressBar?.translatesAutoresizingMaskIntoConstraints = false+ webProgressBar?.leadingAnchor.constraint(equalTo: myWebView!.leadingAnchor).isActive = true+ webProgressBar?.trailingAnchor.constraint(equalTo: myWebView!.trailingAnchor).isActive = true+ webProgressBar?.topAnchor.constraint(equalTo: myWebView!.topAnchor, constant: -2).isActive = true+ webProgressBar?.heightAnchor.constraint(equalToConstant: 2).isActive = true++ if appConfig?.menuEnabled ?? false {++ menuButton = MDCFloatingButton(shape: .default)+ menuButton?.backgroundColor = UIColor(hexaRGB: appConfig?.primaryColor ?? "#43A047")+ menuButton?.translatesAutoresizingMaskIntoConstraints = false+ menuButton?.addTarget(self, action: #selector(self.pressed(sender:)), for: .touchUpInside)+ menuButton?.setImage(#imageLiteral(resourceName: "ic_menu"), for: .normal)+ menuButton?.setImage(#imageLiteral(resourceName: "ic_menu"), for: .selected)+ menuButton?.setImage(#imageLiteral(resourceName: "ic_menu"), for: .highlighted)++ view.addSubview(menuButton!)+ view.bringSubviewToFront(menuButton!)++ let constraints: Array<NSLayoutConstraint> = {+ if appConfig!.menuPosition == "BOTTOM_RIGHT" {+ self.popoverOptions = [+ .type(.up),+ .arrowSize(.zero),+ ]+ return [+ menuButton!.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: 20),+ menuButton!.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -40)+ ]+ } else if appConfig!.menuPosition == "TOP_RIGHT" {+ self.popoverOptions = [+ .type(.down),+ .arrowSize(.zero),+ ]+ return [+ menuButton!.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: 20),+ menuButton!.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 40)+ ]+ } else if appConfig!.menuPosition == "TOP_LEFT" {+ self.popoverOptions = [+ .type(.down),+ .arrowSize(.zero),+ ]+ return [+ menuButton!.leftAnchor.constraint(equalTo: self.view.leftAnchor, constant: 20),+ menuButton!.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 40)+ ]+ }+ self.popoverOptions = [+ .type(.up),+ .arrowSize(.zero),+ ]+ return [+ menuButton!.leftAnchor.constraint(equalTo: self.view.leftAnchor, constant: 20),+ menuButton!.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -40)+ ]+ }()++ NSLayoutConstraint.activate(constraints)+ }+ }++ @objc func pressed(sender: UIButton!) {+ let linkCount = appConfig?.links?.count ?? 0+ let tableView = UITableView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width / 2, height: CGFloat(linkCount * 40)))+ tableView.delegate = self+ tableView.dataSource = self+ tableView.isScrollEnabled = false+ self.popover = Popover(options: self.popoverOptions)+ self.popover!.show(tableView, fromView: self.menuButton!)+ }++ override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {+ if keyPath == "estimatedProgress" {+ if let webView = myWebView {+ webProgressBar?.progress = Float(webView.estimatedProgress);+ }+ }+ }++ func showProgressView() {+ if let progressBar = webProgressBar {+ UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseInOut, animations: {+ progressBar.alpha = 1+ }, completion: nil)+ }+ }++ func hideProgressView() {+ if let progressBar = webProgressBar {+ UIView.animate(withDuration: 0.5, delay: 0, options: .curveEaseInOut, animations: {+ progressBar.alpha = 0+ }, completion: nil)+ }+ }++ func loadURL(url : URL) {+ _ = self.myWebView?.load(URLRequest(url:url))+ }++ internal func handleError(errorCode: Int, description: String, failingUrl: String, isForMainFrame: Bool) {+ print("Error requesting '\(failingUrl)': \(errorCode) (\(description))")++ let alertView = UIAlertController(title: "Error", message: "Error requesting '\(failingUrl)': \(errorCode) (\(description))", preferredStyle: .alert)+ alertView.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))++ self.present(alertView, animated: true, completion: nil)++ self.myWebView?.load(URLRequest(url: URL(string: self.appConfig!.url.stringByURLEncoding()!)!))+ }++}++extension ORViewcontroller: UITableViewDelegate {++ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {+ self.popover?.dismiss()+ loadURL(url: URL(string: appConfig!.links![indexPath.row].pageLink.stringByURLEncoding()!)!)+ }+}++extension ORViewcontroller: UITableViewDataSource {++ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{+ return appConfig?.links?.count ?? 0+ }++ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {+ let cell = UITableViewCell(style: .default, reuseIdentifier: nil)+ cell.textLabel?.text = appConfig!.links![indexPath.row].displayText+ return cell+ }+}++extension ORViewcontroller: WKScriptMessageHandler {+ func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {+ let jsonDictionnary = message.body as? [String : Any]+ if let type = jsonDictionnary?["type"] as? String {+ switch (type) {+ case "provider":+ if let postMessageDict = jsonDictionnary?[DefaultsKey.dataKey] as? [String: Any] {+ if let action = postMessageDict[DefaultsKey.actionKey] as? String {+ if let provider = postMessageDict[DefaultsKey.providerKey] as? String {+ switch (provider) {+ case Providers.push:+ switch(action) {+ case Actions.providerInit:+ pushProvider = PushNotificationProvider()+ pushProvider!.initialize(callback: { initalizeData in+ self.sendData(data: initalizeData)+ })+ case Actions.providerEnable:+ if let consoleId = postMessageDict[GeofenceProvider.consoleIdKey] as? String {+ pushProvider?.enable(consoleId: consoleId, callback: { enableData in+ self.sendData(data: enableData)+ })+ }+ case Actions.providerDisable:+ if let disableData = pushProvider?.disable() {+ sendData(data: disableData)+ }+ default:+ print("Wrong action \(action) for \(provider)")+ }+ case Providers.geofence:+ switch(action) {+ case Actions.providerInit:+ geofenceProvider = GeofenceProvider()+ let initializeData = geofenceProvider!.initialize()+ sendData(data: initializeData)+ case Actions.providerEnable:+ if let consoleId = postMessageDict[GeofenceProvider.consoleIdKey] as? String {+ if let userdefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement),+ let project = userdefaults.string(forKey: DefaultsKey.projectKey),+ let realm = userdefaults.string(forKey: DefaultsKey.realmKey) {+ geofenceProvider?.enable(baseUrl: "https://\(project).openremote.io/api/\(realm)", consoleId: consoleId, callback: { enableData in+ self.sendData(data: enableData)+ DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(5)) {+ self.geofenceProvider?.fetchGeofences()+ }+ })+ }+ }+ case Actions.providerDisable:+ if let disableData = geofenceProvider?.disable() {+ sendData(data: disableData)+ }+ case Actions.geofenceRefresh:+ geofenceProvider?.refreshGeofences()+ case Actions.getLocation:+ geofenceProvider?.getLocation(callback: { locationData in+ if (locationData["data"] as? [String:Any]) == nil {+ let alertController = UIAlertController(title: "Location permission denied",+ message: "In order to get the location it's necessary to give permissions to the app. Do you want to open the settings?",+ preferredStyle: .alert)+ if let settingsUrl = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(settingsUrl) {+ alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { alertAction in+ if UIApplication.shared.canOpenURL(settingsUrl) {+ UIApplication.shared.open(settingsUrl, completionHandler: { (success) in+ print("Settings opened: \(success)") // Prints true+ })+ }+ }))+ alertController.addAction(UIAlertAction(title: "Not now", style: .cancel, handler: nil))+ } else {+ alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))+ }+ self.present(alertController, animated: true, completion: nil)+ }+ self.sendData(data: locationData)+ })+ default:+ print("Wrong action \(action) for \(provider)")+ }+ case Providers.storage:+ switch(action) {+ case Actions.providerInit:+ storageProvider = StorageProvider()+ let initializeData = storageProvider!.initialize()+ sendData(data: initializeData)+ case Actions.providerEnable:+ if let enableData = storageProvider?.enable() {+ sendData(data: enableData)+ }+ case Actions.providerDisable:+ if let disableData = storageProvider?.disable() {+ sendData(data: disableData)+ }+ case Actions.store:+ if let key = postMessageDict["key"] as? String {+ storageProvider?.store(key: key, data: postMessageDict["value"] as? String)+ }+ case Actions.retrieve:+ if let key = postMessageDict["key"] as? String {+ if let retrieveData = storageProvider?.retrieve(key: key) {+ sendData(data: retrieveData)+ }+ }+ default:+ print("Wrong action \(action) for \(provider)")+ }+ default:+ print("Unknown provider type: \(provider )")+ }+ }+ }+ }+ default:+ print("Unknown message type: \(type )")+ }+ }+ }+}++extension ORViewcontroller: WKNavigationDelegate {++ public func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {+ showProgressView()+ }++ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {+ if (navigationAction.request.url?.absoluteString.starts(with: "webbrowser"))! {+ if let url = navigationAction.request.url, var components = URLComponents(url: url, resolvingAgainstBaseURL: false) {+ components.scheme = "https"+ if let newUrl = components.url {+ UIApplication.shared.open(newUrl)+ }+ }+ decisionHandler(.cancel)+ } else {+ let app = UIApplication.shared+ if navigationAction.targetFrame == nil, let url = navigationAction.request.url{+ if app.canOpenURL(url) {+ app.open(url, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]), completionHandler: nil)+ decisionHandler(.cancel)+ }+ } else {+ decisionHandler(.allow)+ }+ }+ }++ func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) {+ if let response = navigationResponse.response as? HTTPURLResponse {+ if response.statusCode != 200 && response.statusCode != 204 {+ decisionHandler(.cancel)++ handleError(errorCode: response.statusCode, description: "Error in request", failingUrl: response.url?.absoluteString ?? "", isForMainFrame: true)+ return+ }+ }+ decisionHandler(.allow)+ }++ func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {+ NSLog("error %@", error.localizedDescription)+ if let err = error as? URLError {++ let httpCode: Int+ switch(err.code) {+ case .cannotFindHost:+ httpCode = 404+ default:+ httpCode = 500+ }++ handleError(errorCode: httpCode, description: err.localizedDescription, failingUrl: err.failureURLString ?? "", isForMainFrame: true)+ } else {+ handleError(errorCode: 0, description: error.localizedDescription, failingUrl: webView.url?.absoluteString ?? "", isForMainFrame: true)+ }+ }++ func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {+ hideProgressView()+ }++ public func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {+ NSLog("error %@", error.localizedDescription)+ if let err = error as? URLError {++ let httpCode: Int+ switch(err.code) {+ case .cannotFindHost:+ httpCode = 404+ default:+ httpCode = 500+ }++ handleError(errorCode: httpCode, description: err.localizedDescription, failingUrl: err.failureURLString ?? "", isForMainFrame: true)+ } else {+ handleError(errorCode: 0, description: error.localizedDescription, failingUrl: webView.url?.absoluteString ?? "", isForMainFrame: true)+ }+ hideProgressView()+ }+}++// Helper function inserted by Swift 4.2 migrator.+fileprivate func convertToUIApplicationOpenExternalURLOptionsKeyDictionary(_ input: [String: Any]) -> [UIApplication.OpenExternalURLOptionsKey: Any] {+ return Dictionary(uniqueKeysWithValues: input.map { key, value in (UIApplication.OpenExternalURLOptionsKey(rawValue: key), value)})+}diff --git a/console/iOS/GenericApp/GenericApp/UI/ProjectViewController.swift b/console/iOS/GenericApp/GenericApp/UI/ProjectViewController.swiftnew file mode 100644index 000000000..fb386b6c0--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/UI/ProjectViewController.swift@@ -0,0 +1,106 @@+//+// ProjectViewController.swift+// GenericApp+//+// Created by Michael Rademaker on 26/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import UIKit+import MaterialComponents.MaterialTextFields++class ProjectViewController: UIViewController {++ var projectName: String?+ var realmName: String?+ var appconfig: ORAppConfig?++ @IBOutlet weak var projectTextInput: ORTextInput!+ @IBOutlet weak var realmTextInput: ORTextInput!+ @IBOutlet weak var connectButton: MDCRaisedButton!++ override func viewDidLoad() {+ super.viewDidLoad()++ let orGreenColor = UIColor(named: "or_green")++ connectButton.backgroundColor = orGreenColor+ connectButton.tintColor = UIColor.white+ }++ override func viewDidAppear(_ animated: Bool) {+ super.viewDidAppear(animated)++ projectTextInput.textField?.delegate = self+ projectTextInput.textField?.autocorrectionType = .no+ projectTextInput.textField?.autocapitalizationType = .none+ projectTextInput.textField?.returnKeyType = .next++ realmTextInput.textField?.delegate = self+ realmTextInput.textField?.autocorrectionType = .no+ realmTextInput.textField?.autocapitalizationType = .none+ realmTextInput.textField?.returnKeyType = .continue+ }++ override func prepare(for segue: UIStoryboardSegue, sender: Any?) {+ if segue.identifier == "goToWebView" {+ let orViewController = segue.destination as! ORViewcontroller+ orViewController.appConfig = self.appconfig+ }+ }++ @IBAction func connectButtonpressed(_ sender: UIButton) {+ if let project = projectName, let realm = realmName {+ requestAppConfig(project, realm)+ }+ }+}++extension ProjectViewController: UITextFieldDelegate {++ func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {+ if textField == projectTextInput.textField {+ projectName = projectTextInput.textField?.text?.appending(string).trimmingCharacters(in: .whitespacesAndNewlines)+ }+ if textField == realmTextInput.textField {+ realmName = realmTextInput?.textField?.text?.appending(string).trimmingCharacters(in: .whitespacesAndNewlines)+ }+ return true+ }++ fileprivate func requestAppConfig(_ project: String, _ realm: String) {+ let apiManager = ApiManager(baseUrl: "https://\(project).openremote.io/api/\(realm)")+ apiManager.getAppConfig(callback: { statusCode, orAppConfig, error in+ DispatchQueue.main.async {+ if statusCode == 200 && error == nil {+ let userDefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement)+ userDefaults?.set(project, forKey: DefaultsKey.projectKey)+ userDefaults?.set(realm, forKey: DefaultsKey.realmKey)+ self.appconfig = orAppConfig++ self.performSegue(withIdentifier: "goToWebView", sender: self)+ } else {+ let alertView = UIAlertController(title: "Error", message: "Error occurred getting app config. Check your input and try again", preferredStyle: .alert)+ alertView.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))++ self.present(alertView, animated: true, completion: nil)+ }+ }+ })+ }++ func textFieldShouldReturn(_ textField: UITextField) -> Bool {+ guard let input = textField.text, !input.isEmpty else {+ return false+ }++ if textField == projectTextInput.textField {+ realmTextInput.textField?.becomeFirstResponder()+ } else if textField == realmTextInput.textField, let project = projectName, let realm = realmName {+ realmTextInput.textField?.resignFirstResponder()+ requestAppConfig(project, realm)+ }++ return true+ }+}diff --git a/console/iOS/GenericApp/GenericApp/UI/SplashViewController.swift b/console/iOS/GenericApp/GenericApp/UI/SplashViewController.swiftnew file mode 100644index 000000000..8d86b343a--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/UI/SplashViewController.swift@@ -0,0 +1,47 @@+//+// SplashController.swift+// GenericApp+//+// Created by Michael Rademaker on 21/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import UIKit++class SplashViewController: UIViewController {++ var appconfig: ORAppConfig?++ override func viewDidAppear(_ animated: Bool) {+ super.viewDidAppear(animated)++ if let userDefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement),+ let project = userDefaults.string(forKey: DefaultsKey.projectKey),+ let realm = userDefaults.string(forKey: DefaultsKey.realmKey) {+ let apiManager = ApiManager(baseUrl: "https://\(project).openremote.io/api/\(realm)")+ apiManager.getAppConfig(callback: { statusCode, orAppConfig, error in+ DispatchQueue.main.async {+ if statusCode == 200 && error == nil {+ let userDefaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement)+ userDefaults?.set(project, forKey: DefaultsKey.projectKey)+ userDefaults?.set(realm, forKey: DefaultsKey.realmKey)+ self.appconfig = orAppConfig++ self.performSegue(withIdentifier: "goToWebView", sender: self)+ } else {+ self.performSegue(withIdentifier: "goToProjectView", sender: self)+ }+ }+ })+ } else {+ self.performSegue(withIdentifier: "goToProjectView", sender: self)+ }+ }++ override func prepare(for segue: UIStoryboardSegue, sender: Any?) {+ if segue.identifier == "goToWebView" {+ let orViewController = segue.destination as! ORViewcontroller+ orViewController.appConfig = self.appconfig+ }+ }+}diff --git a/console/iOS/GenericApp/GenericApp/Utils/Constants.swift b/console/iOS/GenericApp/GenericApp/Utils/Constants.swiftnew file mode 100644index 000000000..e7fb7616f--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Utils/Constants.swift@@ -0,0 +1,84 @@+/*+ * Copyright 2017, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero General Public License as+ * published by the Free Software Foundation, either version 3 of the+ * License, or (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */++import Foundation+import UIKit++public enum DefaultsKey {+ static let groupEntitlement = "group.io.openremote.app"+ static let projectKey = "PROJECT"+ static let realmKey = "REALM"+ static let refreshTokenKey = "REFRESH_TOKEN"+ static let fcmTokenKey = "FCM_TOKEN_KEY"+ static let fcmDeviceIdKey = "FCM_DEVICE_ID_KEY"+ static let actionKey = "action"+ static let buttonsKey = "buttons"+ static let providerKey = "provider"+ static let versionKey = "version"+ static let requiresPermissionKey = "requiresPermission"+ static let hasPermissionKey = "hasPermission"+ static let successKey = "success"+ static let dataKey = "data"+ static let enabledKey = "enabled"+ static let disabledKey = "disabled"+}++public enum Actions {+ static let providerInit = "PROVIDER_INIT"+ static let providerEnable = "PROVIDER_ENABLE"+ static let providerDisable = "PROVIDER_DISABLE"+ static let geofenceRefresh = "GEOFENCE_REFRESH"+ static let store = "STORE"+ static let retrieve = "RETRIEVE"+ static let getLocation = "GET_LOCATION"+}++public enum Providers {+ static let push = "push"+ static let geofence = "geofence"+ static let storage = "storage"+}++public enum NotificationsNames {+ static let isAuthenticated = "isAuthenticated"+ static let isdeviceIdSent = "isdeviceIdSent"+}++public enum Notifications {+ static let needsReachabilityCheck = Notification.Name("NeedsReachabilityCheck")+ static let fullScreenShown = Notification.Name("fullScreenShown")+ static let fullScreenHidden = Notification.Name("fullScreenHidden")+ static let idleTimerFired = Notification.Name("idleTimerFired")+}++public enum ActionType {+ static let actions = "actions"+ static let aps = "aps"+ static let alert = "alert"+ static let title = "title"+ static let type = "type"+ static let appUrl = "appUrl"+ static let silent = "silent"+ static let httpMethod = "httpMethod"+ static let openInBrowser = "openInBrowser"+ static let notificationId = "notification-id"+ static let ACTION_DEEP_LINK = "LINK"+ static let ACTION_ACTUATOR = "ACTUATOR"+}diff --git a/console/iOS/GenericApp/GenericApp/Utils/Reachability.swift b/console/iOS/GenericApp/GenericApp/Utils/Reachability.swiftnew file mode 100644index 000000000..8022c8371--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Utils/Reachability.swift@@ -0,0 +1,327 @@+/*+ Copyright (c) 2014, Ashley Mills+ All rights reserved.++ Redistribution and use in source and binary forms, with or without+ modification, are permitted provided that the following conditions are met:++ 1. Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++ 2. Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+ POSSIBILITY OF SUCH DAMAGE.+ */++import SystemConfiguration+import Foundation++public enum ReachabilityError: Error {+ case FailedToCreateWithAddress(sockaddr_in)+ case FailedToCreateWithHostname(String)+ case UnableToSetCallback+ case UnableToSetDispatchQueue+}++@available(*, unavailable, renamed: "Notification.Name.reachabilityChanged")+public let ReachabilityChangedNotification = NSNotification.Name("ReachabilityChangedNotification")++extension Notification.Name {+ public static let reachabilityChanged = Notification.Name("reachabilityChanged")+}++func callback(reachability:SCNetworkReachability, flags: SCNetworkReachabilityFlags, info: UnsafeMutableRawPointer?) {++ guard let info = info else { return }++ let reachability = Unmanaged<Reachability>.fromOpaque(info).takeUnretainedValue()+ reachability.reachabilityChanged()+}++public class Reachability {++ public typealias NetworkReachable = (Reachability) -> ()+ public typealias NetworkUnreachable = (Reachability) -> ()++ @available(*, unavailable, renamed: "Conection")+ public enum NetworkStatus: CustomStringConvertible {+ case notReachable, reachableViaWiFi, reachableViaWWAN+ public var description: String {+ switch self {+ case .reachableViaWWAN: return "Cellular"+ case .reachableViaWiFi: return "WiFi"+ case .notReachable: return "No Connection"+ }+ }+ }++ public enum Connection: CustomStringConvertible {+ case none, wifi, cellular+ public var description: String {+ switch self {+ case .cellular: return "Cellular"+ case .wifi: return "WiFi"+ case .none: return "No Connection"+ }+ }+ }++ public var whenReachable: NetworkReachable?+ public var whenUnreachable: NetworkUnreachable?++ @available(*, deprecated: 4.0, renamed: "allowsCellularConnection")+ public let reachableOnWWAN: Bool = true++ /// Set to `false` to force Reachability.connection to .none when on cellular connection (default value `true`)+ public var allowsCellularConnection: Bool++ // The notification center on which "reachability changed" events are being posted+ public var notificationCenter: NotificationCenter = NotificationCenter.default++ @available(*, deprecated: 4.0, renamed: "connection.description")+ public var currentReachabilityString: String {+ return "\(connection)"+ }++ @available(*, unavailable, renamed: "connection")+ public var currentReachabilityStatus: Connection {+ return connection+ }++ public var connection: Connection {++ guard isReachableFlagSet else { return .none }++ // If we're reachable, but not on an iOS device (i.e. simulator), we must be on WiFi+ guard isRunningOnDevice else { return .wifi }++ var connection = Connection.none++ if !isConnectionRequiredFlagSet {+ connection = .wifi+ }++ if isConnectionOnTrafficOrDemandFlagSet {+ if !isInterventionRequiredFlagSet {+ connection = .wifi+ }+ }++ if isOnWWANFlagSet {+ if !allowsCellularConnection {+ connection = .none+ } else {+ connection = .cellular+ }+ }++ return connection+ }++ fileprivate var previousFlags: SCNetworkReachabilityFlags?++ fileprivate var isRunningOnDevice: Bool = {+ #if targetEnvironment(simulator)+ return false+ #else+ return true+ #endif+ }()++ fileprivate var notifierRunning = false+ fileprivate let reachabilityRef: SCNetworkReachability++ fileprivate let reachabilitySerialQueue = DispatchQueue(label: "uk.co.ashleymills.reachability")++ required public init(reachabilityRef: SCNetworkReachability) {+ allowsCellularConnection = true+ self.reachabilityRef = reachabilityRef+ }++ public convenience init?(hostname: String) {++ guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else { return nil }++ self.init(reachabilityRef: ref)+ }++ public convenience init?() {++ var zeroAddress = sockaddr()+ zeroAddress.sa_len = UInt8(MemoryLayout<sockaddr>.size)+ zeroAddress.sa_family = sa_family_t(AF_INET)++ guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else { return nil }++ self.init(reachabilityRef: ref)+ }++ deinit {+ stopNotifier()+ }+}++public extension Reachability {++ // MARK: - *** Notifier methods ***+ func startNotifier() throws {++ guard !notifierRunning else { return }++ var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)+ context.info = UnsafeMutableRawPointer(Unmanaged<Reachability>.passUnretained(self).toOpaque())+ if !SCNetworkReachabilitySetCallback(reachabilityRef, callback, &context) {+ stopNotifier()+ throw ReachabilityError.UnableToSetCallback+ }++ if !SCNetworkReachabilitySetDispatchQueue(reachabilityRef, reachabilitySerialQueue) {+ stopNotifier()+ throw ReachabilityError.UnableToSetDispatchQueue+ }++ // Perform an initial check+ reachabilitySerialQueue.async {+ self.reachabilityChanged()+ }++ notifierRunning = true+ }++ func stopNotifier() {+ defer { notifierRunning = false }++ SCNetworkReachabilitySetCallback(reachabilityRef, nil, nil)+ SCNetworkReachabilitySetDispatchQueue(reachabilityRef, nil)+ }++ // MARK: - *** Connection test methods ***+ @available(*, deprecated: 4.0, message: "Please use `connection != .none`")+ var isReachable: Bool {++ guard isReachableFlagSet else { return false }++ if isConnectionRequiredAndTransientFlagSet {+ return false+ }++ if isRunningOnDevice {+ if isOnWWANFlagSet && !reachableOnWWAN {+ // We don't want to connect when on cellular connection+ return false+ }+ }++ return true+ }++ @available(*, deprecated: 4.0, message: "Please use `connection == .cellular`")+ var isReachableViaWWAN: Bool {+ // Check we're not on the simulator, we're REACHABLE and check we're on WWAN+ return isRunningOnDevice && isReachableFlagSet && isOnWWANFlagSet+ }++ @available(*, deprecated: 4.0, message: "Please use `connection == .wifi`")+ var isReachableViaWiFi: Bool {++ // Check we're reachable+ guard isReachableFlagSet else { return false }++ // If reachable we're reachable, but not on an iOS device (i.e. simulator), we must be on WiFi+ guard isRunningOnDevice else { return true }++ // Check we're NOT on WWAN+ return !isOnWWANFlagSet+ }++ var description: String {++ let W = isRunningOnDevice ? (isOnWWANFlagSet ? "W" : "-") : "X"+ let R = isReachableFlagSet ? "R" : "-"+ let c = isConnectionRequiredFlagSet ? "c" : "-"+ let t = isTransientConnectionFlagSet ? "t" : "-"+ let i = isInterventionRequiredFlagSet ? "i" : "-"+ let C = isConnectionOnTrafficFlagSet ? "C" : "-"+ let D = isConnectionOnDemandFlagSet ? "D" : "-"+ let l = isLocalAddressFlagSet ? "l" : "-"+ let d = isDirectFlagSet ? "d" : "-"++ return "\(W)\(R) \(c)\(t)\(i)\(C)\(D)\(l)\(d)"+ }+}++fileprivate extension Reachability {++ func reachabilityChanged() {+ guard previousFlags != flags else { return }++ let block = connection != .none ? whenReachable : whenUnreachable++ DispatchQueue.main.async {+ block?(self)+ self.notificationCenter.post(name: .reachabilityChanged, object:self)+ }++ previousFlags = flags+ }++ var isOnWWANFlagSet: Bool {+ #if os(iOS)+ return flags.contains(.isWWAN)+ #else+ return false+ #endif+ }+ var isReachableFlagSet: Bool {+ return flags.contains(.reachable)+ }+ var isConnectionRequiredFlagSet: Bool {+ return flags.contains(.connectionRequired)+ }+ var isInterventionRequiredFlagSet: Bool {+ return flags.contains(.interventionRequired)+ }+ var isConnectionOnTrafficFlagSet: Bool {+ return flags.contains(.connectionOnTraffic)+ }+ var isConnectionOnDemandFlagSet: Bool {+ return flags.contains(.connectionOnDemand)+ }+ var isConnectionOnTrafficOrDemandFlagSet: Bool {+ return !flags.intersection([.connectionOnTraffic, .connectionOnDemand]).isEmpty+ }+ var isTransientConnectionFlagSet: Bool {+ return flags.contains(.transientConnection)+ }+ var isLocalAddressFlagSet: Bool {+ return flags.contains(.isLocalAddress)+ }+ var isDirectFlagSet: Bool {+ return flags.contains(.isDirect)+ }+ var isConnectionRequiredAndTransientFlagSet: Bool {+ return flags.intersection([.connectionRequired, .transientConnection]) == [.connectionRequired, .transientConnection]+ }++ var flags: SCNetworkReachabilityFlags {+ var flags = SCNetworkReachabilityFlags()+ if SCNetworkReachabilityGetFlags(reachabilityRef, &flags) {+ return flags+ } else {+ return SCNetworkReachabilityFlags()+ }+ }+}+diff --git a/console/iOS/GenericApp/GenericApp/Utils/String+Utils.swift b/console/iOS/GenericApp/GenericApp/Utils/String+Utils.swiftnew file mode 100644index 000000000..a1aff48ce--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Utils/String+Utils.swift@@ -0,0 +1,25 @@+//+// String+Utils.swift+// GenericApp+//+// Created by Michael Rademaker on 26/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import Foundation++extension String {++ func stringByURLEncoding() -> String? {++ let characters = CharacterSet.urlQueryAllowed.union(CharacterSet(charactersIn: "#"))++ guard let encodedString = self.addingPercentEncoding(withAllowedCharacters: characters) else {+ return nil+ }++ return encodedString++ }++}diff --git a/console/iOS/GenericApp/GenericApp/Utils/UIColor+Utils.swift b/console/iOS/GenericApp/GenericApp/Utils/UIColor+Utils.swiftnew file mode 100644index 000000000..395a66aca--- /dev/null+++ b/console/iOS/GenericApp/GenericApp/Utils/UIColor+Utils.swift@@ -0,0 +1,53 @@+//+// UIColor+Utils.swift+// GenericApp+//+// Created by Michael Rademaker on 26/10/2020.+// Copyright © 2020 OpenRemote. All rights reserved.+//++import Foundation+import UIKit++extension UIColor {+ convenience init?(hexaRGB: String, alpha: CGFloat = 1) {+ var chars = Array(hexaRGB.hasPrefix("#") ? hexaRGB.dropFirst() : hexaRGB[...])+ switch chars.count {+ case 3: chars = chars.flatMap { [$0, $0] }+ case 6: break+ default: return nil+ }+ self.init(red: .init(strtoul(String(chars[0...1]), nil, 16)) / 255,+ green: .init(strtoul(String(chars[2...3]), nil, 16)) / 255,+ blue: .init(strtoul(String(chars[4...5]), nil, 16)) / 255,+ alpha: alpha)+ }++ convenience init?(hexaRGBA: String) {+ var chars = Array(hexaRGBA.hasPrefix("#") ? hexaRGBA.dropFirst() : hexaRGBA[...])+ switch chars.count {+ case 3: chars = chars.flatMap { [$0, $0] }; fallthrough+ case 6: chars.append(contentsOf: ["F","F"])+ case 8: break+ default: return nil+ }+ self.init(red: .init(strtoul(String(chars[0...1]), nil, 16)) / 255,+ green: .init(strtoul(String(chars[2...3]), nil, 16)) / 255,+ blue: .init(strtoul(String(chars[4...5]), nil, 16)) / 255,+ alpha: .init(strtoul(String(chars[6...7]), nil, 16)) / 255)+ }++ convenience init?(hexaARGB: String) {+ var chars = Array(hexaARGB.hasPrefix("#") ? hexaARGB.dropFirst() : hexaARGB[...])+ switch chars.count {+ case 3: chars = chars.flatMap { [$0, $0] }; fallthrough+ case 6: chars.append(contentsOf: ["F","F"])+ case 8: break+ default: return nil+ }+ self.init(red: .init(strtoul(String(chars[2...3]), nil, 16)) / 255,+ green: .init(strtoul(String(chars[4...5]), nil, 16)) / 255,+ blue: .init(strtoul(String(chars[6...7]), nil, 16)) / 255,+ alpha: .init(strtoul(String(chars[0...1]), nil, 16)) / 255)+ }+}diff --git a/console/iOS/GenericApp/NotificationService/NotificationService.entitlements b/console/iOS/GenericApp/NotificationService/NotificationService.entitlementsnew file mode 100644index 000000000..e69de29bbdiff --git a/console/iOS/GenericApp/NotificationService/NotificationService.swift b/console/iOS/GenericApp/NotificationService/NotificationService.swiftindex 9fe5cbe2c..f4e9ff1d4 100644--- a/console/iOS/GenericApp/NotificationService/NotificationService.swift+++ b/console/iOS/GenericApp/NotificationService/NotificationService.swift@@ -7,12 +7,86 @@//import UserNotifications-import ORLib-class NotificationService: ORNotificationService {+class NotificationService: UNNotificationServiceExtension {- override init() {- ORAppGroup.entitlement = "io.openremote.app"- super.init()+ public var contentHandler: ((UNNotificationContent) -> Void)?+ public var bestAttemptContent: UNMutableNotificationContent?++ open override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {+ self.contentHandler = contentHandler+ bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)++ if let bestAttemptContent = bestAttemptContent {++ let categoryName = "openremoteNotification"+ bestAttemptContent.categoryIdentifier = categoryName++ //Buttons+ if let buttonsString = bestAttemptContent.userInfo[DefaultsKey.buttonsKey] as? String {+ if let buttonsData = buttonsString.data(using: .utf8) {+ if let buttons = try? JSONDecoder().decode([ORPushNotificationButton].self, from: buttonsData) {++ var notificationActions = [UNNotificationAction]()++ for button in buttons {+ if button.action != nil {+ notificationActions.append(UNNotificationAction(identifier: button.title, title: button.title, options: UNNotificationActionOptions.foreground))+ } else {+ notificationActions.append(UNNotificationAction(identifier: "declineAction", title: button.title, options: UNNotificationActionOptions.destructive))+ }+ }++ let category = UNNotificationCategory(identifier: categoryName, actions: notificationActions, intentIdentifiers: [], options: [])+ let categories : Set = [category]+ UNUserNotificationCenter.current().setNotificationCategories(categories)+ }+ }+ }+ //Actions+ if let actionString = bestAttemptContent.userInfo[DefaultsKey.actionKey] as? String {+ if let actionsData = actionString.data(using: .utf8){+ if let action = try? JSONDecoder().decode(ORPushNotificationAction.self, from: actionsData) {++ bestAttemptContent.userInfo[ActionType.appUrl] = action.url+ bestAttemptContent.userInfo[ActionType.silent] = action.silent+ bestAttemptContent.userInfo[ActionType.openInBrowser] = action.openInBrowser+ bestAttemptContent.userInfo[ActionType.httpMethod] = action.httpMethod ?? "GET"+ bestAttemptContent.userInfo[DefaultsKey.dataKey] = action.data ?? "null"+ }+ }+ }++ if let notificationIdString = bestAttemptContent.userInfo[ActionType.notificationId] as? String, let notificationId = Int64(notificationIdString) {+ if let defaults = UserDefaults(suiteName: DefaultsKey.groupEntitlement), let consoleId = defaults.string(forKey: GeofenceProvider.consoleIdKey) {+ ORNotificationResource.sharedInstance.notificationDelivered(notificationId: notificationId, targetId: consoleId)+ }+ }++ contentHandler(bestAttemptContent.copy() as! UNNotificationContent)+ }+ }+++ open override func serviceExtensionTimeWillExpire() {+ // Called just before the extension will be terminated by the system.+ // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.+ NSLog("NotifExtension Time has expired")+ if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {+ //Actions+ if let actionString = bestAttemptContent.userInfo[DefaultsKey.actionKey] as? String {+ if let actionsData = actionString.data(using: .utf8){+ if let action = try? JSONDecoder().decode(ORPushNotificationAction.self, from: actionsData) {++ bestAttemptContent.userInfo[ActionType.appUrl] = action.url+ bestAttemptContent.userInfo[ActionType.silent] = action.silent+ bestAttemptContent.userInfo[ActionType.openInBrowser] = action.openInBrowser+ bestAttemptContent.userInfo[ActionType.httpMethod] = action.httpMethod ?? "GET"+ bestAttemptContent.userInfo[DefaultsKey.dataKey] = action.data ?? "null"+ }+ }+ }+ contentHandler(bestAttemptContent)+ }}}diff --git a/console/iOS/GenericApp/Podfile b/console/iOS/GenericApp/Podfileindex c97dbcd7a..30dbc6695 100644--- a/console/iOS/GenericApp/Podfile+++ b/console/iOS/GenericApp/Podfile@@ -13,14 +13,12 @@ endtarget 'GenericApp' doproject 'GenericApp'shared_pods+ pod 'MaterialComponents/TextFields'+ pod 'MaterialComponents/Buttons'+ pod 'Popover'endtarget 'NotificationService' doproject 'GenericApp'shared_podsend--target 'ORLib' do- project '../ORLib/ORLib'- shared_pods-enddiff --git a/console/iOS/ORLib/ORLib.xcodeproj/project.pbxproj b/console/iOS/ORLib/ORLib.xcodeproj/project.pbxprojindex d0d85ae4d..0f84570d1 100644--- a/console/iOS/ORLib/ORLib.xcodeproj/project.pbxproj+++ b/console/iOS/ORLib/ORLib.xcodeproj/project.pbxproj@@ -29,7 +29,7 @@/* Begin PBXFileReference section */4C33B4762209D10200681732 /* StorageProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageProvider.swift; sourceTree = "<group>"; };4C4C2FB71FD8044A0071CBDA /* ORNotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORNotificationService.swift; sourceTree = "<group>"; };- 4C56E5E420C583FB004483C7 /* ORAssetResoure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORAssetResoure.swift; sourceTree = "<group>"; };+ 4C56E5E420C583FB004483C7 /* ORAssetResoure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ORAssetResoure.swift; path = ../../GenericApp/GenericApp/Network/ORAssetResoure.swift; sourceTree = "<group>"; };4C77278320BC13E800322CBC /* PushNotificationProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushNotificationProvider.swift; sourceTree = "<group>"; };4C77278420BC13E800322CBC /* GeofenceProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeofenceProvider.swift; sourceTree = "<group>"; };4C82D73A1FC58ED2009DE853 /* ORLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ORLib.framework; sourceTree = BUILT_PRODUCTS_DIR; };@@ -43,7 +43,7 @@4C82D7541FC590FB009DE853 /* TokenManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenManager.swift; sourceTree = "<group>"; };4C9FC2EF211B2F8000D8FD18 /* ORPushNotificationButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORPushNotificationButton.swift; sourceTree = "<group>"; };4C9FC2F0211B2F8100D8FD18 /* ORPushNotificationAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORPushNotificationAction.swift; sourceTree = "<group>"; };- 4C9FC2F1211B2F8100D8FD18 /* ORNotificationResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORNotificationResource.swift; sourceTree = "<group>"; };+ 4C9FC2F1211B2F8100D8FD18 /* ORNotificationResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ORNotificationResource.swift; path = ../../GenericApp/GenericApp/Network/ORNotificationResource.swift; sourceTree = "<group>"; };4CBC0D461FD6DDA1000BE8B1 /* Reachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };572EED7F064AF79DDABE9FC8 /* Pods-ORLib.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ORLib.release.xcconfig"; path = "../GenericApp/Pods/Target Support Files/Pods-ORLib/Pods-ORLib.release.xcconfig"; sourceTree = "<group>"; };978B95045017E64853668497 /* Pods_ORLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ORLib.framework; sourceTree = BUILT_PRODUCTS_DIR; };diff --git a/console/iOS/ORLib/ORLib.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist b/console/iOS/ORLib/ORLib.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plistindex ac3b17f0a..7eee96b8d 100644--- a/console/iOS/ORLib/ORLib.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist+++ b/console/iOS/ORLib/ORLib.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist@@ -7,7 +7,7 @@<key>ORLib.xcscheme_^#shared#^_</key><dict><key>orderHint</key>- <integer>4</integer>+ <integer>0</integer></dict></dict></dict>diff --git a/console/iOS/ORLib/ORLib/ORAssetResoure.swift b/console/iOS/ORLib/ORLib/ORAssetResoure.swiftdeleted file mode 100644index 150e0ce65..000000000--- a/console/iOS/ORLib/ORLib/ORAssetResoure.swift+++ /dev/null@@ -1,60 +0,0 @@-//-// ORAssetResoure.swift-// GoogleToolboxForMac-//-// Created by Michael Rademaker on 04/06/2018.-//--import UIKit--open class ORAssetResoure: NSObject, URLSessionDelegate {-- public static let sharedInstance = ORAssetResoure()-- private override init() {- super.init()- }-- open func updateAssetAttribute(assetId : String, attributeName : String, rawJson : Data) {- UIApplication.shared.isNetworkActivityIndicatorVisible = true- TokenManager.sharedInstance.getAccessToken { (accessTokenResult) in- switch accessTokenResult {- case .Failure(let error) :- UIApplication.shared.isNetworkActivityIndicatorVisible = false- ErrorManager.showError(error: error!)- case .Success(let accessToken) :- self.updateAssetAttribute(assetId: assetId, attributeName: attributeName, accessToken: accessToken, rawJson: rawJson)- }- }- }-- open func updatePublicAssetAttibute(assetId : String, attributeName : String, rawJson : Data) {- updateAssetAttribute(assetId: assetId, attributeName: attributeName, accessToken: nil, rawJson: rawJson)- }-- private func updateAssetAttribute(assetId : String, attributeName : String, accessToken :String?, rawJson : Data) {- guard let urlRequest = URL(string: String(String(format: "\(ORServer.scheme)://%@/%@/asset/%@/attribute/%@", ORServer.hostURL, ORServer.realm, assetId, attributeName))) else { return }- let request = NSMutableURLRequest(url: urlRequest)- request.httpMethod = "PUT"- request.addValue("application/json", forHTTPHeaderField: "Content-Type")- request.httpBody = rawJson- if let token = accessToken {- request.addValue(String(format:"Bearer %@", token), forHTTPHeaderField: "Authorization")- }- let sessionConfiguration = URLSessionConfiguration.default- let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue : nil)- let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in- DispatchQueue.main.async {- UIApplication.shared.isNetworkActivityIndicatorVisible = false- if (error != nil) {- NSLog("error %@", (error! as NSError).localizedDescription)- let error = NSError(domain: "", code: 0, userInfo: [- NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")- ])- ErrorManager.showError(error: error)- }- }- })- reqDataTask.resume()- }-}diff --git a/console/iOS/ORLib/ORLib/ORNotificationResource.swift b/console/iOS/ORLib/ORLib/ORNotificationResource.swiftdeleted file mode 100644index 80abaafd4..000000000--- a/console/iOS/ORLib/ORLib/ORNotificationResource.swift+++ /dev/null@@ -1,64 +0,0 @@- //-// ORNotificationResource.swift-// ORLib-//-// Created by Michael Rademaker on 08/08/2018.-//--import UIKit--public class ORNotificationResource: NSObject, URLSessionDelegate {-- public static let sharedInstance = ORNotificationResource()-- private override init() {- super.init()- }-- public func notificationDelivered(notificationId : Int64, targetId : String) {- guard let urlRequest = URL(string: "\(ORServer.scheme)://\(ORServer.hostURL)/\(ORServer.realm)/notification/\(notificationId)/delivered?targetId=\(targetId)") else { return }- let request = NSMutableURLRequest(url: urlRequest)- request.httpMethod = "PUT"- let sessionConfiguration = URLSessionConfiguration.default- let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue : nil)- let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in- DispatchQueue.main.async {- UIApplication.shared.isNetworkActivityIndicatorVisible = false- if (error != nil) {- NSLog("error %@", (error! as NSError).localizedDescription)- let error = NSError(domain: "", code: 0, userInfo: [- NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")- ])- print(error)- }- }- })- reqDataTask.resume()- }-- public func notificationAcknowledged(notificationId : Int64, targetId : String, acknowledgement: String) {- guard let urlRequest = URL(string: "\(ORServer.scheme)://\(ORServer.hostURL)/\(ORServer.realm)/notification/\(notificationId)/acknowledged?targetId=\(targetId)") else { return }- let request = NSMutableURLRequest(url: urlRequest)- request.httpMethod = "PUT"-- if let json = try? JSONSerialization.data(withJSONObject: ["acknowledgement": acknowledgement], options: []) {- request.addValue("application/json", forHTTPHeaderField: "Content-Type")- request.httpBody = json- }- let sessionConfiguration = URLSessionConfiguration.default- let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue : nil)- let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in- DispatchQueue.main.async {- UIApplication.shared.isNetworkActivityIndicatorVisible = false- if (error != nil) {- NSLog("error %@", (error! as NSError).localizedDescription)- let error = NSError(domain: "", code: 0, userInfo: [- NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")- ])- print(error)- }- }- })- reqDataTask.resume()- }-}diff --git a/console/iOS/OpenRemoteApp/NotificationService/Info.plist b/console/iOS/OpenRemoteApp/NotificationService/Info.plistdeleted file mode 100644index 1d4d66d4f..000000000--- a/console/iOS/OpenRemoteApp/NotificationService/Info.plist+++ /dev/null@@ -1,31 +0,0 @@-<?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>CFBundleDevelopmentRegion</key>- <string>$(DEVELOPMENT_LANGUAGE)</string>- <key>CFBundleDisplayName</key>- <string>NotificationService</string>- <key>CFBundleExecutable</key>- <string>$(EXECUTABLE_NAME)</string>- <key>CFBundleIdentifier</key>- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>- <key>CFBundleInfoDictionaryVersion</key>- <string>6.0</string>- <key>CFBundleName</key>- <string>$(PRODUCT_NAME)</string>- <key>CFBundlePackageType</key>- <string>XPC!</string>- <key>CFBundleShortVersionString</key>- <string>1.0</string>- <key>CFBundleVersion</key>- <string>1</string>- <key>NSExtension</key>- <dict>- <key>NSExtensionPointIdentifier</key>- <string>com.apple.usernotifications.service</string>- <key>NSExtensionPrincipalClass</key>- <string>$(PRODUCT_MODULE_NAME).NotificationService</string>- </dict>-</dict>-</plist>diff --git a/console/iOS/OpenRemoteApp/NotificationService/NotificationService.swift b/console/iOS/OpenRemoteApp/NotificationService/NotificationService.swiftdeleted file mode 100644index c1b55f0b9..000000000--- a/console/iOS/OpenRemoteApp/NotificationService/NotificationService.swift+++ /dev/null@@ -1,14 +0,0 @@-//-// NotificationService.swift-// NotificationService-//-// Created by Michael Rademaker on 13/12/2017.-// Copyright © 2017 OpenRemote. All rights reserved.-//--import UserNotifications-import ORLib--class NotificationService: ORNotificationService {--}diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.pbxproj b/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.pbxprojdeleted file mode 100644index 085042fd0..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.pbxproj+++ /dev/null@@ -1,578 +0,0 @@-// !$*UTF8*$!-{- archiveVersion = 1;- classes = {- };- objectVersion = 48;- objects = {--/* Begin PBXBuildFile section */- 4C11BB2D2002318A006722D4 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4C11BB2C2002318A006722D4 /* GoogleService-Info.plist */; };- 4C5C57911FE17E0800C13164 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5C57901FE17E0800C13164 /* AppDelegate.swift */; };- 4C5C57961FE17E0800C13164 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C5C57941FE17E0800C13164 /* Main.storyboard */; };- 4C5C57981FE17E0800C13164 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C5C57971FE17E0800C13164 /* Assets.xcassets */; };- 4C5C579B1FE17E0800C13164 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4C5C57991FE17E0800C13164 /* LaunchScreen.storyboard */; };- 4C5C57A91FE17E9A00C13164 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C5C57A81FE17E9A00C13164 /* NotificationService.swift */; };- 4C5C57AD1FE17E9A00C13164 /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 4C5C57A61FE17E9A00C13164 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };- 533AF522E91F3A168A61A155 /* Pods_NotificationService.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C33B7EA5FDD7CD2B200BB292 /* Pods_NotificationService.framework */; };- 745D4E3E0E4659E8D532BCB4 /* Pods_OpenRemoteApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C71D8848F376BB85FB36813F /* Pods_OpenRemoteApp.framework */; };-/* End PBXBuildFile section */--/* Begin PBXContainerItemProxy section */- 4C5C57AB1FE17E9A00C13164 /* PBXContainerItemProxy */ = {- isa = PBXContainerItemProxy;- containerPortal = 4C5C57851FE17E0800C13164 /* Project object */;- proxyType = 1;- remoteGlobalIDString = 4C5C57A51FE17E9A00C13164;- remoteInfo = NotificationService;- };-/* End PBXContainerItemProxy section */--/* Begin PBXCopyFilesBuildPhase section */- 4C5C57B11FE17E9A00C13164 /* Embed App Extensions */ = {- isa = PBXCopyFilesBuildPhase;- buildActionMask = 2147483647;- dstPath = "";- dstSubfolderSpec = 13;- files = (- 4C5C57AD1FE17E9A00C13164 /* NotificationService.appex in Embed App Extensions */,- );- name = "Embed App Extensions";- runOnlyForDeploymentPostprocessing = 0;- };-/* End PBXCopyFilesBuildPhase section */--/* Begin PBXFileReference section */- 4C11BB2C2002318A006722D4 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "OpenRemoteApp/GoogleService-Info.plist"; sourceTree = "<group>"; };- 4C11BB2E200232BE006722D4 /* OpenRemoteApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OpenRemoteApp.entitlements; sourceTree = "<group>"; };- 4C5C578D1FE17E0800C13164 /* OpenRemoteApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenRemoteApp.app; sourceTree = BUILT_PRODUCTS_DIR; };- 4C5C57901FE17E0800C13164 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };- 4C5C57951FE17E0800C13164 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };- 4C5C57971FE17E0800C13164 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };- 4C5C579A1FE17E0800C13164 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };- 4C5C579C1FE17E0800C13164 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };- 4C5C57A61FE17E9A00C13164 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };- 4C5C57A81FE17E9A00C13164 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };- 4C5C57AA1FE17E9A00C13164 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };- 6249BC146B82E48514C35274 /* Pods-OpenRemoteApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OpenRemoteApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-OpenRemoteApp/Pods-OpenRemoteApp.release.xcconfig"; sourceTree = "<group>"; };- 70B8E16EFB2F872AC0397DE5 /* Pods-NotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NotificationService/Pods-NotificationService.debug.xcconfig"; sourceTree = "<group>"; };- C33B7EA5FDD7CD2B200BB292 /* Pods_NotificationService.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NotificationService.framework; sourceTree = BUILT_PRODUCTS_DIR; };- C71D8848F376BB85FB36813F /* Pods_OpenRemoteApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OpenRemoteApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };- FB93D125B872DE05BAEB4945 /* Pods-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.release.xcconfig"; path = "Pods/Target Support Files/Pods-NotificationService/Pods-NotificationService.release.xcconfig"; sourceTree = "<group>"; };- FE9B277C832E79ADE129A6D1 /* Pods-OpenRemoteApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OpenRemoteApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OpenRemoteApp/Pods-OpenRemoteApp.debug.xcconfig"; sourceTree = "<group>"; };-/* End PBXFileReference section */--/* Begin PBXFrameworksBuildPhase section */- 4C5C578A1FE17E0800C13164 /* Frameworks */ = {- isa = PBXFrameworksBuildPhase;- buildActionMask = 2147483647;- files = (- 745D4E3E0E4659E8D532BCB4 /* Pods_OpenRemoteApp.framework in Frameworks */,- );- runOnlyForDeploymentPostprocessing = 0;- };- 4C5C57A31FE17E9A00C13164 /* Frameworks */ = {- isa = PBXFrameworksBuildPhase;- buildActionMask = 2147483647;- files = (- 533AF522E91F3A168A61A155 /* Pods_NotificationService.framework in Frameworks */,- );- runOnlyForDeploymentPostprocessing = 0;- };-/* End PBXFrameworksBuildPhase section */--/* Begin PBXGroup section */- 4C5C57841FE17E0800C13164 = {- isa = PBXGroup;- children = (- 4C11BB2C2002318A006722D4 /* GoogleService-Info.plist */,- 4C5C578F1FE17E0800C13164 /* OpenRemoteApp */,- 4C5C57A71FE17E9A00C13164 /* NotificationService */,- 4C5C578E1FE17E0800C13164 /* Products */,- F0F4731015788A04AFAED34E /* Pods */,- 58120D821DFD7F352C43662A /* Frameworks */,- );- sourceTree = "<group>";- };- 4C5C578E1FE17E0800C13164 /* Products */ = {- isa = PBXGroup;- children = (- 4C5C578D1FE17E0800C13164 /* OpenRemoteApp.app */,- 4C5C57A61FE17E9A00C13164 /* NotificationService.appex */,- );- name = Products;- sourceTree = "<group>";- };- 4C5C578F1FE17E0800C13164 /* OpenRemoteApp */ = {- isa = PBXGroup;- children = (- 4C11BB2E200232BE006722D4 /* OpenRemoteApp.entitlements */,- 4C5C57901FE17E0800C13164 /* AppDelegate.swift */,- 4C5C57941FE17E0800C13164 /* Main.storyboard */,- 4C5C57971FE17E0800C13164 /* Assets.xcassets */,- 4C5C57991FE17E0800C13164 /* LaunchScreen.storyboard */,- 4C5C579C1FE17E0800C13164 /* Info.plist */,- );- path = OpenRemoteApp;- sourceTree = "<group>";- };- 4C5C57A71FE17E9A00C13164 /* NotificationService */ = {- isa = PBXGroup;- children = (- 4C5C57A81FE17E9A00C13164 /* NotificationService.swift */,- 4C5C57AA1FE17E9A00C13164 /* Info.plist */,- );- path = NotificationService;- sourceTree = "<group>";- };- 58120D821DFD7F352C43662A /* Frameworks */ = {- isa = PBXGroup;- children = (- C33B7EA5FDD7CD2B200BB292 /* Pods_NotificationService.framework */,- C71D8848F376BB85FB36813F /* Pods_OpenRemoteApp.framework */,- );- name = Frameworks;- sourceTree = "<group>";- };- F0F4731015788A04AFAED34E /* Pods */ = {- isa = PBXGroup;- children = (- 70B8E16EFB2F872AC0397DE5 /* Pods-NotificationService.debug.xcconfig */,- FB93D125B872DE05BAEB4945 /* Pods-NotificationService.release.xcconfig */,- FE9B277C832E79ADE129A6D1 /* Pods-OpenRemoteApp.debug.xcconfig */,- 6249BC146B82E48514C35274 /* Pods-OpenRemoteApp.release.xcconfig */,- );- name = Pods;- sourceTree = "<group>";- };-/* End PBXGroup section */--/* Begin PBXNativeTarget section */- 4C5C578C1FE17E0800C13164 /* OpenRemoteApp */ = {- isa = PBXNativeTarget;- buildConfigurationList = 4C5C579F1FE17E0800C13164 /* Build configuration list for PBXNativeTarget "OpenRemoteApp" */;- buildPhases = (- 5CCDFAB0EA3073DD8150C99A /* [CP] Check Pods Manifest.lock */,- 4C5C57891FE17E0800C13164 /* Sources */,- 4C5C578A1FE17E0800C13164 /* Frameworks */,- 4C5C578B1FE17E0800C13164 /* Resources */,- 4C5C57B11FE17E9A00C13164 /* Embed App Extensions */,- 8F293E2545B0279AC2CAF14A /* [CP] Embed Pods Frameworks */,- );- buildRules = (- );- dependencies = (- 4C5C57AC1FE17E9A00C13164 /* PBXTargetDependency */,- );- name = OpenRemoteApp;- productName = OpenRemoteApp;- productReference = 4C5C578D1FE17E0800C13164 /* OpenRemoteApp.app */;- productType = "com.apple.product-type.application";- };- 4C5C57A51FE17E9A00C13164 /* NotificationService */ = {- isa = PBXNativeTarget;- buildConfigurationList = 4C5C57AE1FE17E9A00C13164 /* Build configuration list for PBXNativeTarget "NotificationService" */;- buildPhases = (- B615D7D73F17A7733FCCA9A2 /* [CP] Check Pods Manifest.lock */,- 4C5C57A21FE17E9A00C13164 /* Sources */,- 4C5C57A31FE17E9A00C13164 /* Frameworks */,- 4C5C57A41FE17E9A00C13164 /* Resources */,- );- buildRules = (- );- dependencies = (- );- name = NotificationService;- productName = NotificationService;- productReference = 4C5C57A61FE17E9A00C13164 /* NotificationService.appex */;- productType = "com.apple.product-type.app-extension";- };-/* End PBXNativeTarget section */--/* Begin PBXProject section */- 4C5C57851FE17E0800C13164 /* Project object */ = {- isa = PBXProject;- attributes = {- LastSwiftUpdateCheck = 0920;- LastUpgradeCheck = 0920;- ORGANIZATIONNAME = OpenRemote;- TargetAttributes = {- 4C5C578C1FE17E0800C13164 = {- CreatedOnToolsVersion = 9.2;- ProvisioningStyle = Automatic;- SystemCapabilities = {- com.apple.BackgroundModes = {- enabled = 1;- };- com.apple.Push = {- enabled = 1;- };- };- };- 4C5C57A51FE17E9A00C13164 = {- CreatedOnToolsVersion = 9.2;- ProvisioningStyle = Automatic;- };- };- };- buildConfigurationList = 4C5C57881FE17E0800C13164 /* Build configuration list for PBXProject "OpenRemoteApp" */;- compatibilityVersion = "Xcode 8.0";- developmentRegion = en;- hasScannedForEncodings = 0;- knownRegions = (- en,- Base,- );- mainGroup = 4C5C57841FE17E0800C13164;- productRefGroup = 4C5C578E1FE17E0800C13164 /* Products */;- projectDirPath = "";- projectRoot = "";- targets = (- 4C5C578C1FE17E0800C13164 /* OpenRemoteApp */,- 4C5C57A51FE17E9A00C13164 /* NotificationService */,- );- };-/* End PBXProject section */--/* Begin PBXResourcesBuildPhase section */- 4C5C578B1FE17E0800C13164 /* Resources */ = {- isa = PBXResourcesBuildPhase;- buildActionMask = 2147483647;- files = (- 4C5C579B1FE17E0800C13164 /* LaunchScreen.storyboard in Resources */,- 4C11BB2D2002318A006722D4 /* GoogleService-Info.plist in Resources */,- 4C5C57981FE17E0800C13164 /* Assets.xcassets in Resources */,- 4C5C57961FE17E0800C13164 /* Main.storyboard in Resources */,- );- runOnlyForDeploymentPostprocessing = 0;- };- 4C5C57A41FE17E9A00C13164 /* Resources */ = {- isa = PBXResourcesBuildPhase;- buildActionMask = 2147483647;- files = (- );- runOnlyForDeploymentPostprocessing = 0;- };-/* End PBXResourcesBuildPhase section */--/* Begin PBXShellScriptBuildPhase section */- 5CCDFAB0EA3073DD8150C99A /* [CP] Check Pods Manifest.lock */ = {- isa = PBXShellScriptBuildPhase;- buildActionMask = 2147483647;- files = (- );- inputPaths = (- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",- "${PODS_ROOT}/Manifest.lock",- );- name = "[CP] Check Pods Manifest.lock";- outputPaths = (- "$(DERIVED_FILE_DIR)/Pods-OpenRemoteApp-checkManifestLockResult.txt",- );- 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";- showEnvVarsInLog = 0;- };- 8F293E2545B0279AC2CAF14A /* [CP] Embed Pods Frameworks */ = {- isa = PBXShellScriptBuildPhase;- buildActionMask = 2147483647;- files = (- );- inputPaths = (- "${SRCROOT}/Pods/Target Support Files/Pods-OpenRemoteApp/Pods-OpenRemoteApp-frameworks.sh",- "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework",- "${BUILT_PRODUCTS_DIR}/ORLib/ORLib.framework",- "${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",- "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",- );- name = "[CP] Embed Pods Frameworks";- outputPaths = (- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework",- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ORLib.framework",- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",- );- runOnlyForDeploymentPostprocessing = 0;- shellPath = /bin/sh;- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OpenRemoteApp/Pods-OpenRemoteApp-frameworks.sh\"\n";- showEnvVarsInLog = 0;- };- B615D7D73F17A7733FCCA9A2 /* [CP] Check Pods Manifest.lock */ = {- isa = PBXShellScriptBuildPhase;- buildActionMask = 2147483647;- files = (- );- inputPaths = (- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",- "${PODS_ROOT}/Manifest.lock",- );- name = "[CP] Check Pods Manifest.lock";- outputPaths = (- "$(DERIVED_FILE_DIR)/Pods-NotificationService-checkManifestLockResult.txt",- );- 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";- showEnvVarsInLog = 0;- };-/* End PBXShellScriptBuildPhase section */--/* Begin PBXSourcesBuildPhase section */- 4C5C57891FE17E0800C13164 /* Sources */ = {- isa = PBXSourcesBuildPhase;- buildActionMask = 2147483647;- files = (- 4C5C57911FE17E0800C13164 /* AppDelegate.swift in Sources */,- );- runOnlyForDeploymentPostprocessing = 0;- };- 4C5C57A21FE17E9A00C13164 /* Sources */ = {- isa = PBXSourcesBuildPhase;- buildActionMask = 2147483647;- files = (- 4C5C57A91FE17E9A00C13164 /* NotificationService.swift in Sources */,- );- runOnlyForDeploymentPostprocessing = 0;- };-/* End PBXSourcesBuildPhase section */--/* Begin PBXTargetDependency section */- 4C5C57AC1FE17E9A00C13164 /* PBXTargetDependency */ = {- isa = PBXTargetDependency;- target = 4C5C57A51FE17E9A00C13164 /* NotificationService */;- targetProxy = 4C5C57AB1FE17E9A00C13164 /* PBXContainerItemProxy */;- };-/* End PBXTargetDependency section */--/* Begin PBXVariantGroup section */- 4C5C57941FE17E0800C13164 /* Main.storyboard */ = {- isa = PBXVariantGroup;- children = (- 4C5C57951FE17E0800C13164 /* Base */,- );- name = Main.storyboard;- sourceTree = "<group>";- };- 4C5C57991FE17E0800C13164 /* LaunchScreen.storyboard */ = {- isa = PBXVariantGroup;- children = (- 4C5C579A1FE17E0800C13164 /* Base */,- );- name = LaunchScreen.storyboard;- sourceTree = "<group>";- };-/* End PBXVariantGroup section */--/* Begin XCBuildConfiguration section */- 4C5C579D1FE17E0800C13164 /* Debug */ = {- isa = XCBuildConfiguration;- buildSettings = {- ALWAYS_SEARCH_USER_PATHS = NO;- CLANG_ANALYZER_NONNULL = YES;- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";- CLANG_CXX_LIBRARY = "libc++";- CLANG_ENABLE_MODULES = YES;- CLANG_ENABLE_OBJC_ARC = YES;- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;- CLANG_WARN_BOOL_CONVERSION = YES;- CLANG_WARN_COMMA = YES;- CLANG_WARN_CONSTANT_CONVERSION = YES;- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;- CLANG_WARN_EMPTY_BODY = YES;- CLANG_WARN_ENUM_CONVERSION = YES;- CLANG_WARN_INFINITE_RECURSION = YES;- CLANG_WARN_INT_CONVERSION = YES;- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;- CLANG_WARN_STRICT_PROTOTYPES = YES;- CLANG_WARN_SUSPICIOUS_MOVE = YES;- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;- CLANG_WARN_UNREACHABLE_CODE = YES;- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;- CODE_SIGN_IDENTITY = "iPhone Developer";- COPY_PHASE_STRIP = NO;- DEBUG_INFORMATION_FORMAT = dwarf;- ENABLE_STRICT_OBJC_MSGSEND = YES;- ENABLE_TESTABILITY = YES;- GCC_C_LANGUAGE_STANDARD = gnu11;- GCC_DYNAMIC_NO_PIC = NO;- GCC_NO_COMMON_BLOCKS = YES;- GCC_OPTIMIZATION_LEVEL = 0;- GCC_PREPROCESSOR_DEFINITIONS = (- "DEBUG=1",- "$(inherited)",- );- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;- GCC_WARN_UNDECLARED_SELECTOR = YES;- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;- GCC_WARN_UNUSED_FUNCTION = YES;- GCC_WARN_UNUSED_VARIABLE = YES;- IPHONEOS_DEPLOYMENT_TARGET = 11.2;- MTL_ENABLE_DEBUG_INFO = YES;- ONLY_ACTIVE_ARCH = YES;- SDKROOT = iphoneos;- SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;- SWIFT_OPTIMIZATION_LEVEL = "-Onone";- };- name = Debug;- };- 4C5C579E1FE17E0800C13164 /* Release */ = {- isa = XCBuildConfiguration;- buildSettings = {- ALWAYS_SEARCH_USER_PATHS = NO;- CLANG_ANALYZER_NONNULL = YES;- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";- CLANG_CXX_LIBRARY = "libc++";- CLANG_ENABLE_MODULES = YES;- CLANG_ENABLE_OBJC_ARC = YES;- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;- CLANG_WARN_BOOL_CONVERSION = YES;- CLANG_WARN_COMMA = YES;- CLANG_WARN_CONSTANT_CONVERSION = YES;- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;- CLANG_WARN_EMPTY_BODY = YES;- CLANG_WARN_ENUM_CONVERSION = YES;- CLANG_WARN_INFINITE_RECURSION = YES;- CLANG_WARN_INT_CONVERSION = YES;- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;- CLANG_WARN_STRICT_PROTOTYPES = YES;- CLANG_WARN_SUSPICIOUS_MOVE = YES;- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;- CLANG_WARN_UNREACHABLE_CODE = YES;- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;- CODE_SIGN_IDENTITY = "iPhone Developer";- COPY_PHASE_STRIP = NO;- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";- ENABLE_NS_ASSERTIONS = NO;- ENABLE_STRICT_OBJC_MSGSEND = YES;- GCC_C_LANGUAGE_STANDARD = gnu11;- GCC_NO_COMMON_BLOCKS = YES;- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;- GCC_WARN_UNDECLARED_SELECTOR = YES;- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;- GCC_WARN_UNUSED_FUNCTION = YES;- GCC_WARN_UNUSED_VARIABLE = YES;- IPHONEOS_DEPLOYMENT_TARGET = 11.2;- MTL_ENABLE_DEBUG_INFO = NO;- SDKROOT = iphoneos;- SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";- VALIDATE_PRODUCT = YES;- };- name = Release;- };- 4C5C57A01FE17E0800C13164 /* Debug */ = {- isa = XCBuildConfiguration;- baseConfigurationReference = FE9B277C832E79ADE129A6D1 /* Pods-OpenRemoteApp.debug.xcconfig */;- buildSettings = {- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;- CODE_SIGN_ENTITLEMENTS = OpenRemoteApp/OpenRemoteApp.entitlements;- CODE_SIGN_STYLE = Automatic;- DEVELOPMENT_TEAM = MD7Q2M7GWA;- INFOPLIST_FILE = OpenRemoteApp/Info.plist;- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";- PRODUCT_BUNDLE_IDENTIFIER = org.openremote.OpenRemoteApp;- PRODUCT_NAME = "$(TARGET_NAME)";- SWIFT_VERSION = 4.0;- TARGETED_DEVICE_FAMILY = "1,2";- };- name = Debug;- };- 4C5C57A11FE17E0800C13164 /* Release */ = {- isa = XCBuildConfiguration;- baseConfigurationReference = 6249BC146B82E48514C35274 /* Pods-OpenRemoteApp.release.xcconfig */;- buildSettings = {- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;- CODE_SIGN_ENTITLEMENTS = OpenRemoteApp/OpenRemoteApp.entitlements;- CODE_SIGN_STYLE = Automatic;- DEVELOPMENT_TEAM = MD7Q2M7GWA;- INFOPLIST_FILE = OpenRemoteApp/Info.plist;- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";- PRODUCT_BUNDLE_IDENTIFIER = org.openremote.OpenRemoteApp;- PRODUCT_NAME = "$(TARGET_NAME)";- SWIFT_VERSION = 4.0;- TARGETED_DEVICE_FAMILY = "1,2";- };- name = Release;- };- 4C5C57AF1FE17E9A00C13164 /* Debug */ = {- isa = XCBuildConfiguration;- baseConfigurationReference = 70B8E16EFB2F872AC0397DE5 /* Pods-NotificationService.debug.xcconfig */;- buildSettings = {- APPLICATION_EXTENSION_API_ONLY = NO;- CODE_SIGN_STYLE = Automatic;- DEVELOPMENT_TEAM = MD7Q2M7GWA;- INFOPLIST_FILE = NotificationService/Info.plist;- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";- PRODUCT_BUNDLE_IDENTIFIER = org.openremote.OpenRemoteApp.NotificationService;- PRODUCT_NAME = "$(TARGET_NAME)";- SKIP_INSTALL = YES;- SWIFT_VERSION = 4.0;- TARGETED_DEVICE_FAMILY = "1,2";- };- name = Debug;- };- 4C5C57B01FE17E9A00C13164 /* Release */ = {- isa = XCBuildConfiguration;- baseConfigurationReference = FB93D125B872DE05BAEB4945 /* Pods-NotificationService.release.xcconfig */;- buildSettings = {- APPLICATION_EXTENSION_API_ONLY = NO;- CODE_SIGN_STYLE = Automatic;- DEVELOPMENT_TEAM = MD7Q2M7GWA;- INFOPLIST_FILE = NotificationService/Info.plist;- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";- PRODUCT_BUNDLE_IDENTIFIER = org.openremote.OpenRemoteApp.NotificationService;- PRODUCT_NAME = "$(TARGET_NAME)";- SKIP_INSTALL = YES;- SWIFT_VERSION = 4.0;- TARGETED_DEVICE_FAMILY = "1,2";- };- name = Release;- };-/* End XCBuildConfiguration section */--/* Begin XCConfigurationList section */- 4C5C57881FE17E0800C13164 /* Build configuration list for PBXProject "OpenRemoteApp" */ = {- isa = XCConfigurationList;- buildConfigurations = (- 4C5C579D1FE17E0800C13164 /* Debug */,- 4C5C579E1FE17E0800C13164 /* Release */,- );- defaultConfigurationIsVisible = 0;- defaultConfigurationName = Release;- };- 4C5C579F1FE17E0800C13164 /* Build configuration list for PBXNativeTarget "OpenRemoteApp" */ = {- isa = XCConfigurationList;- buildConfigurations = (- 4C5C57A01FE17E0800C13164 /* Debug */,- 4C5C57A11FE17E0800C13164 /* Release */,- );- defaultConfigurationIsVisible = 0;- defaultConfigurationName = Release;- };- 4C5C57AE1FE17E9A00C13164 /* Build configuration list for PBXNativeTarget "NotificationService" */ = {- isa = XCConfigurationList;- buildConfigurations = (- 4C5C57AF1FE17E9A00C13164 /* Debug */,- 4C5C57B01FE17E9A00C13164 /* Release */,- );- defaultConfigurationIsVisible = 0;- defaultConfigurationName = Release;- };-/* End XCConfigurationList section */- };- rootObject = 4C5C57851FE17E0800C13164 /* Project object */;-}diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/contents.xcworkspacedatadeleted file mode 100644index b789fcae6..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata+++ /dev/null@@ -1,7 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<Workspace- version = "1.0">- <FileRef- location = "self:OpenRemoteApp.xcodeproj">- </FileRef>-</Workspace>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistdeleted file mode 100644index 18d981003..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist+++ /dev/null@@ -1,8 +0,0 @@-<?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>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate b/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstatedeleted file mode 100644index cc4f0c190..000000000Binary files a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/project.xcworkspace/xcuserdata/michael.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differdiff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist b/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plistdeleted file mode 100644index d03b2c6b1..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp.xcodeproj/xcuserdata/michael.xcuserdatad/xcschemes/xcschememanagement.plist+++ /dev/null@@ -1,19 +0,0 @@-<?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>SchemeUserState</key>- <dict>- <key>NotificationService.xcscheme</key>- <dict>- <key>orderHint</key>- <integer>7</integer>- </dict>- <key>OpenRemoteApp.xcscheme</key>- <dict>- <key>orderHint</key>- <integer>6</integer>- </dict>- </dict>-</dict>-</plist>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/AppDelegate.swift b/console/iOS/OpenRemoteApp/OpenRemoteApp/AppDelegate.swiftdeleted file mode 100644index c75cd082d..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/AppDelegate.swift+++ /dev/null@@ -1,24 +0,0 @@-//-// AppDelegate.swift-// OpenRemoteApp-//-// Created by Michael Rademaker on 13/12/2017.-// Copyright © 2017 OpenRemote. All rights reserved.-//--import UIKit-import ORLib--@UIApplicationMain-class AppDelegate: ORAppDelegate {- override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?) -> Bool {-- ORServer.hostURL = "example.com"- ORServer.realm = "example"-- ORAppGroup.entitlement = "group.com.company.example"-- return super.application(application, didFinishLaunchingWithOptions: launchOptions);- }-}-diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/console/iOS/OpenRemoteApp/OpenRemoteApp/Assets.xcassets/AppIcon.appiconset/Contents.jsondeleted file mode 100644index 1d060ed28..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/Assets.xcassets/AppIcon.appiconset/Contents.json+++ /dev/null@@ -1,93 +0,0 @@-{- "images" : [- {- "idiom" : "iphone",- "size" : "20x20",- "scale" : "2x"- },- {- "idiom" : "iphone",- "size" : "20x20",- "scale" : "3x"- },- {- "idiom" : "iphone",- "size" : "29x29",- "scale" : "2x"- },- {- "idiom" : "iphone",- "size" : "29x29",- "scale" : "3x"- },- {- "idiom" : "iphone",- "size" : "40x40",- "scale" : "2x"- },- {- "idiom" : "iphone",- "size" : "40x40",- "scale" : "3x"- },- {- "idiom" : "iphone",- "size" : "60x60",- "scale" : "2x"- },- {- "idiom" : "iphone",- "size" : "60x60",- "scale" : "3x"- },- {- "idiom" : "ipad",- "size" : "20x20",- "scale" : "1x"- },- {- "idiom" : "ipad",- "size" : "20x20",- "scale" : "2x"- },- {- "idiom" : "ipad",- "size" : "29x29",- "scale" : "1x"- },- {- "idiom" : "ipad",- "size" : "29x29",- "scale" : "2x"- },- {- "idiom" : "ipad",- "size" : "40x40",- "scale" : "1x"- },- {- "idiom" : "ipad",- "size" : "40x40",- "scale" : "2x"- },- {- "idiom" : "ipad",- "size" : "76x76",- "scale" : "1x"- },- {- "idiom" : "ipad",- "size" : "76x76",- "scale" : "2x"- },- {- "idiom" : "ipad",- "size" : "83.5x83.5",- "scale" : "2x"- }- ],- "info" : {- "version" : 1,- "author" : "xcode"- }-}\ No newline at end of filediff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/Base.lproj/LaunchScreen.storyboard b/console/iOS/OpenRemoteApp/OpenRemoteApp/Base.lproj/LaunchScreen.storyboarddeleted file mode 100644index f83f6fd58..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/Base.lproj/LaunchScreen.storyboard+++ /dev/null@@ -1,25 +0,0 @@-<?xml version="1.0" encoding="UTF-8" standalone="no"?>-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">- <dependencies>- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>- <capability name="Safe area layout guides" minToolsVersion="9.0"/>- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>- </dependencies>- <scenes>- <!--View Controller-->- <scene sceneID="EHf-IW-A2E">- <objects>- <viewController id="01J-lp-oVM" sceneMemberID="viewController">- <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">- <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>- <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>- <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>- </view>- </viewController>- <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>- </objects>- <point key="canvasLocation" x="53" y="375"/>- </scene>- </scenes>-</document>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/Base.lproj/Main.storyboard b/console/iOS/OpenRemoteApp/OpenRemoteApp/Base.lproj/Main.storyboarddeleted file mode 100644index 725c340e0..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/Base.lproj/Main.storyboard+++ /dev/null@@ -1,44 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">- <device id="retina4_7" orientation="portrait">- <adaptation id="fullscreen"/>- </device>- <dependencies>- <deployment identifier="iOS"/>- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>- <capability name="Safe area layout guides" minToolsVersion="9.0"/>- <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>- </dependencies>- <scenes>- <!--Login View Controller-->- <scene sceneID="tne-QT-ifu">- <objects>- <viewController id="BYZ-38-t0r" customClass="ORLoginViewController" customModule="ORLib" sceneMemberID="viewController">- <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">- <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>- <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>- <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>- </view>- </viewController>- <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>- </objects>- <point key="canvasLocation" x="-12" y="171"/>- </scene>- <!--Viewcontroller-->- <scene sceneID="Imo-nz-JsH">- <objects>- <viewController id="yGB-tk-49L" customClass="ORViewcontroller" customModule="ORLib" sceneMemberID="viewController">- <view key="view" contentMode="scaleToFill" id="glp-uL-veB">- <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>- <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>- <viewLayoutGuide key="safeArea" id="H0W-2s-xIZ"/>- </view>- </viewController>- <placeholder placeholderIdentifier="IBFirstResponder" id="a1Y-gK-oXw" userLabel="First Responder" sceneMemberID="firstResponder"/>- </objects>- <point key="canvasLocation" x="776" y="172"/>- </scene>- </scenes>-</document>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/GoogleService-Info.plist b/console/iOS/OpenRemoteApp/OpenRemoteApp/GoogleService-Info.plistdeleted file mode 100644index 7a9907e93..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/GoogleService-Info.plist+++ /dev/null@@ -1,40 +0,0 @@-<?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>AD_UNIT_ID_FOR_BANNER_TEST</key>- <string>ca-app-pub-3940256099942544/2934735716</string>- <key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>- <string>ca-app-pub-3940256099942544/4411468910</string>- <key>CLIENT_ID</key>- <string>423923723820-74pcf7mst282obnoe1g82dlhtgmu01pb.apps.googleusercontent.com</string>- <key>REVERSED_CLIENT_ID</key>- <string>com.googleusercontent.apps.423923723820-74pcf7mst282obnoe1g82dlhtgmu01pb</string>- <key>API_KEY</key>- <string>AIzaSyC5VHfpI8AMEf7k4V9fV1kg9Lv6xENXD7I</string>- <key>GCM_SENDER_ID</key>- <string>423923723820</string>- <key>PLIST_VERSION</key>- <string>1</string>- <key>BUNDLE_ID</key>- <string>com.company.example</string>- <key>PROJECT_ID</key>- <string>example-c156b</string>- <key>STORAGE_BUCKET</key>- <string>example-c156b.appspot.com</string>- <key>IS_ADS_ENABLED</key>- <true/>- <key>IS_ANALYTICS_ENABLED</key>- <false/>- <key>IS_APPINVITE_ENABLED</key>- <false/>- <key>IS_GCM_ENABLED</key>- <true/>- <key>IS_SIGNIN_ENABLED</key>- <true/>- <key>GOOGLE_APP_ID</key>- <string>1:423923723820:ios:b18bf9b5f8e49573</string>- <key>DATABASE_URL</key>- <string>https://example-c156b.firebaseio.com</string>-</dict>-</plist>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/Info.plist b/console/iOS/OpenRemoteApp/OpenRemoteApp/Info.plistdeleted file mode 100644index ccbab9476..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/Info.plist+++ /dev/null@@ -1,49 +0,0 @@-<?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>CFBundleDevelopmentRegion</key>- <string>$(DEVELOPMENT_LANGUAGE)</string>- <key>CFBundleExecutable</key>- <string>$(EXECUTABLE_NAME)</string>- <key>CFBundleIdentifier</key>- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>- <key>CFBundleInfoDictionaryVersion</key>- <string>6.0</string>- <key>CFBundleName</key>- <string>$(PRODUCT_NAME)</string>- <key>CFBundlePackageType</key>- <string>APPL</string>- <key>CFBundleShortVersionString</key>- <string>1.0</string>- <key>CFBundleVersion</key>- <string>1</string>- <key>LSRequiresIPhoneOS</key>- <true/>- <key>UIBackgroundModes</key>- <array>- <string>remote-notification</string>- </array>- <key>UILaunchStoryboardName</key>- <string>LaunchScreen</string>- <key>UIMainStoryboardFile</key>- <string>Main</string>- <key>UIRequiredDeviceCapabilities</key>- <array>- <string>armv7</string>- </array>- <key>UISupportedInterfaceOrientations</key>- <array>- <string>UIInterfaceOrientationPortrait</string>- <string>UIInterfaceOrientationLandscapeLeft</string>- <string>UIInterfaceOrientationLandscapeRight</string>- </array>- <key>UISupportedInterfaceOrientations~ipad</key>- <array>- <string>UIInterfaceOrientationPortrait</string>- <string>UIInterfaceOrientationPortraitUpsideDown</string>- <string>UIInterfaceOrientationLandscapeLeft</string>- <string>UIInterfaceOrientationLandscapeRight</string>- </array>-</dict>-</plist>diff --git a/console/iOS/OpenRemoteApp/OpenRemoteApp/OpenRemoteApp.entitlements b/console/iOS/OpenRemoteApp/OpenRemoteApp/OpenRemoteApp.entitlementsdeleted file mode 100644index 903def2af..000000000--- a/console/iOS/OpenRemoteApp/OpenRemoteApp/OpenRemoteApp.entitlements+++ /dev/null@@ -1,8 +0,0 @@-<?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>aps-environment</key>- <string>development</string>-</dict>-</plist>