Skip to content

Commit 02faad0

Browse files
authored
Merge pull request #16 from mwaylabs/feature/REL-6078_maintain
REL-6078: maintain
2 parents ef1a19e + 018a6f8 commit 02faad0

File tree

6 files changed

+50
-57
lines changed

6 files changed

+50
-57
lines changed

.idea/workspace.xml

Lines changed: 0 additions & 45 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,25 @@ Provides a method and a stream which calls on managed app configuration changes.
77

88
## Additional Information
99

10+
### Android:
11+
1012
https://developer.android.com/work/managed-configurations
1113

12-
### Test on Android:
14+
#### How to Test
1315
It could be that you need to factory reset your android device before installing TestDPC for testing.
1416
* https://github.com/googlesamples/android-testdpc
1517
* https://developer.android.com/work/guide#testing
1618

19+
### iOS/macOS
20+
https://developer.apple.com/documentation/foundation/nsuserdefaults#2926901
21+
22+
#### How to Test
23+
24+
Apple does not provide a dev environment to test managed app configuration so you will need to use one of the available
25+
MDM provider. This package was created to work with [Relution](https://relution.io).
26+
You can create a free Account and enroll up to 5 devices to test your implementation.
27+
28+
For more information check out the documentation of the used MDM provider how to add managed app configuration to your app.
1729

1830
## How to use
1931

android/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ group 'io.mway.managed_configurations'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.9.21'
5+
ext.kotlin_version = '2.0.20'
66
repositories {
77
google()
8-
jcenter()
8+
mavenCentral()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.1.2'
12+
classpath 'com.android.tools.build:gradle:8.7.1'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
1616

1717
rootProject.allprojects {
1818
repositories {
1919
google()
20-
jcenter()
20+
mavenCentral()
2121
}
2222
}
2323

@@ -28,12 +28,13 @@ android {
2828
if (project.android.hasProperty('namespace')) {
2929
namespace 'io.mway.managed_configurations'
3030
}
31-
compileSdkVersion 31
3231

3332
sourceSets {
3433
main.java.srcDirs += 'src/main/kotlin'
3534
}
35+
3636
defaultConfig {
37+
compileSdk 31
3738
minSdkVersion 21
3839
}
3940

@@ -44,7 +45,6 @@ android {
4445
}
4546

4647
dependencies {
47-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
48-
implementation 'com.google.code.gson:gson:2.8.9'
48+
implementation 'com.google.code.gson:gson:2.11.0'
4949
implementation 'androidx.enterprise:enterprise-feedback:1.1.0'
5050
}

darwin/Classes/ManagedConfigurationsPlugin.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ManagedConfigurationsPlugin: NSObject, FlutterPlugin {
3838
}
3939

4040
/**
41-
Handles the getManagedConfiguration method ivoked by flutter side.
41+
Handles the getManagedConfiguration method invoked by flutter side.
4242
Writes the managed configuration in the result as json converted to String
4343
If something fails returns empty json string ("{}")
4444
*/
@@ -63,7 +63,7 @@ public class ManagedConfigurationsPlugin: NSObject, FlutterPlugin {
6363
Used to handle the Event channel
6464
On Flutter stream subscribe creates an observer on UsersDefault.
6565
Calls on changes the mdConfigChange method
66-
Its not necassary to remove this observer as it will anyway removed if not used
66+
Its not necessary to remove this observer as it will anyway removed if not used
6767
*/
6868
class SwiftStreamHandler: NSObject, FlutterStreamHandler {
6969
/// save the sink as we need it to put the changes in it
@@ -81,7 +81,7 @@ class SwiftStreamHandler: NSObject, FlutterStreamHandler {
8181
}
8282

8383
/**
84-
handles the notification if something happend on UserDefaults
84+
handles the notification if something happened on UserDefaults
8585
Extracts the managed configuration and converts them to json String. Checks if something changed.
8686
If so, puts in the sink (Flutter side will be notified)
8787
*/
@@ -90,7 +90,6 @@ class SwiftStreamHandler: NSObject, FlutterStreamHandler {
9090
let jsonData = try? JSONSerialization.data(withJSONObject: managedConf, options: .prettyPrinted),
9191
let jsonString = String(data: jsonData, encoding: .utf8),
9292
let events = eventsVariable{
93-
print("calling dies das")
9493
if lastJsonString == nil {
9594
lastJsonString = jsonString
9695
events(jsonString)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTracking</key>
6+
<false/>
7+
<key>NSPrivacyTrackingDomains</key>
8+
<array>
9+
</array>
10+
<key>NSPrivacyCollectedDataTypes</key>
11+
<array>
12+
</array>
13+
<key>NSPrivacyAccessedAPITypes</key>
14+
<array>
15+
<dict>
16+
<key>NSPrivacyAccessedAPIType</key>
17+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
18+
<key>NSPrivacyAccessedAPITypeReasons</key>
19+
<array>
20+
<string>AC6B.1</string>
21+
</array>
22+
</dict>
23+
</array>
24+
</dict>
25+
</plist>
26+

darwin/managed_configurations.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A new flutter plugin project.
1414
s.author = { 'Your Company' => '[email protected]' }
1515
s.source = { :path => '.' }
1616
s.source_files = 'Classes/**/*'
17+
s.resource_bundles = {'package_name_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
1718

1819
s.platform = :ios, '9.0'
1920
s.platform = :osx, '10.11'

0 commit comments

Comments
 (0)