From 4a05da6d0f754258fc60155961577ca9b8a458f2 Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 14:27:59 +0100 Subject: [PATCH 1/8] Add Ably agent --- android/ably-agent.gradle | 18 ++++++++++++++++++ android/build.gradle | 4 +++- .../ably/flutter/plugin/AblyMessageCodec.java | 3 +++ example/ios/Podfile.lock | 4 ++-- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- ios/Classes/AblyFlutter.m | 4 ++-- ios/Classes/codec/AblyFlutterReader.m | 2 ++ ios/ably_flutter.podspec | 13 +++++++++++-- 8 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 android/ably-agent.gradle diff --git a/android/ably-agent.gradle b/android/ably-agent.gradle new file mode 100644 index 000000000..a9662b1b3 --- /dev/null +++ b/android/ably-agent.gradle @@ -0,0 +1,18 @@ +import java.util.regex.Matcher +import java.util.regex.Pattern + +String libraryVersion = "" +File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') + +if (pubspec.exists()) { + String yaml = pubspec.text + // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. + Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) + if (versionMatcher.find()) libraryVersion = versionMatcher.group(1).replaceAll("\\+", "-") +} + +android { + defaultConfig { + buildConfigField 'String', 'VERSION', "\"${libraryVersion}\"" + } +} diff --git a/android/build.gradle b/android/build.gradle index f740cda99..5b427576c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,7 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' dependencies { - implementation 'io.ably:ably-android:1.2.7' + implementation 'io.ably:ably-android:1.2.10' implementation 'com.google.firebase:firebase-messaging:22.0.0' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' } @@ -52,3 +52,5 @@ android { disable 'InvalidPackage' } } + +apply from: file("./ably-agent.gradle") diff --git a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java index 1df0c7ab5..35f04b1b4 100644 --- a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java +++ b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java @@ -308,6 +308,9 @@ private PlatformClientOptions decodeClientOptions(Map jsonMap) { readValueFromJson(jsonMap, PlatformConstants.TxClientOptions.channelRetryTimeout, v -> o.channelRetryTimeout = (Integer) v); readValueFromJson(jsonMap, PlatformConstants.TxClientOptions.transportParams, v -> o.transportParams = (Param[]) v); + o.agents = new HashMap<>(); + o.agents.put("ably-flutter", BuildConfig.VERSION); + return new PlatformClientOptions(o, jsonMap.containsKey(PlatformConstants.TxClientOptions.hasAuthCallback) ? ((boolean) jsonMap.get(PlatformConstants.TxClientOptions.hasAuthCallback)) : false); } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 9c08e51e2..7ed9385eb 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2,7 +2,7 @@ PODS: - Ably (1.2.6): - AblyDeltaCodec (= 1.3.1) - msgpack (= 0.4.0) - - ably_flutter (0.0.5): + - ably_flutter (1.2.2-preview.1): - Ably (= 1.2.6) - Flutter - AblyDeltaCodec (1.3.1) @@ -45,7 +45,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Ably: 6f58ab63407c71f984ef61112f60525cf9bc634a - ably_flutter: 80537c79ba7cdb1ced594e45c2089bc3ffee1349 + ably_flutter: 8f4fc03a170c13c855e1e78abf6d3e1ade2279aa AblyDeltaCodec: f66a44f743b2a0703f29a65208321d4ea43362d6 device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1b1189f2e..16396c3bf 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -43,7 +43,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - launchStyle = "1" + launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" diff --git a/ios/Classes/AblyFlutter.m b/ios/Classes/AblyFlutter.m index cffecc581..be067ea03 100644 --- a/ios/Classes/AblyFlutter.m +++ b/ios/Classes/AblyFlutter.m @@ -59,7 +59,7 @@ -(NSNumber *)createRestWithOptions:(AblyFlutterClientOptions *const)options { if (!tokenData) { NSLog(@"No token data received %@", tokenData); callback(nil, [NSError errorWithDomain:ARTAblyErrorDomain - code:ARTCodeErrorAuthConfiguredProviderFailure userInfo:nil]); + code:ARTErrorAuthConfiguredProviderFailure userInfo:nil]); } if ([tokenData isKindOfClass:[FlutterError class]]) { NSLog(@"Error getting token data %@", tokenData); callback(nil, tokenData); @@ -95,7 +95,7 @@ -(NSNumber *)createRealtimeWithOptions:(AblyFlutterClientOptions *const)options if (!tokenData) { NSLog(@"No token data received %@", tokenData); callback(nil, [NSError errorWithDomain:ARTAblyErrorDomain - code:ARTCodeErrorAuthConfiguredProviderFailure userInfo:nil]); + code:ARTErrorAuthConfiguredProviderFailure userInfo:nil]); } if ([tokenData isKindOfClass:[FlutterError class]]) { NSLog(@"Error getting token data %@", tokenData); callback(nil, tokenData); diff --git a/ios/Classes/codec/AblyFlutterReader.m b/ios/Classes/codec/AblyFlutterReader.m index bbbbb8e99..4481900e9 100644 --- a/ios/Classes/codec/AblyFlutterReader.m +++ b/ios/Classes/codec/AblyFlutterReader.m @@ -144,6 +144,8 @@ use an explicitly received null from Dart (manifesting this side as a nil id) // httpMaxRetryCount, realtimeRequestTimeout, fallbackRetryTimeout, // channelRetryTimeout, transportParams, asyncHttpThreadpoolSize, pushFullWait // track @ https://github.com/ably/ably-flutter/issues/14 + + [o addAgent:@"ably-flutter" version: LIBRARY_VERSION]; AblyFlutterClientOptions *const co = [AblyFlutterClientOptions new]; ON_VALUE(^(const id value) { diff --git a/ios/ably_flutter.podspec b/ios/ably_flutter.podspec index 6a24e6799..52b2b8230 100644 --- a/ios/ably_flutter.podspec +++ b/ios/ably_flutter.podspec @@ -2,9 +2,14 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint ably_flutter.podspec` to validate before publishing. # +require 'yaml' + +pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) +library_version = pubspec['version'].gsub('+', '-') + Pod::Spec.new do |s| s.name = 'ably_flutter' - s.version = '0.0.5' + s.version = library_version s.summary = 'Ably Cocoa platform support for our Flutter plugin.' s.homepage = 'https://www.ably.com/' s.license = 'Apache 2.0' @@ -18,6 +23,10 @@ Pod::Spec.new do |s| s.ios.deployment_target = '10.0' # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.pod_target_xcconfig = { + 'DEFINES_MODULE' => 'YES', + 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64', + 'GCC_PREPROCESSOR_DEFINITIONS' => "LIBRARY_VERSION=\\@\\\"#{library_version}\\\"" + } s.swift_version = '5.0' end From c45f6802956b251242a57d5dcd32eb4adb29c06f Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:11:49 +0100 Subject: [PATCH 2/8] Fix compile time error --- ios/Classes/AblyFlutter.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Classes/AblyFlutter.m b/ios/Classes/AblyFlutter.m index a8cf2fcd6..643353c8a 100644 --- a/ios/Classes/AblyFlutter.m +++ b/ios/Classes/AblyFlutter.m @@ -59,7 +59,7 @@ -(NSNumber *)createRestWithOptions:(AblyFlutterClientOptions *const)options { if (!tokenData) { NSLog(@"No token data received %@", tokenData); callback(nil, [NSError errorWithDomain:ARTAblyErrorDomain - code:ARTErrorAuthConfiguredProviderFailure userInfo:nil]); + code:ARTCodeErrorAuthConfiguredProviderFailure userInfo:nil]); } if ([tokenData isKindOfClass:[FlutterError class]]) { NSLog(@"Error getting token data %@", tokenData); callback(nil, tokenData); @@ -95,7 +95,7 @@ -(NSNumber *)createRealtimeWithOptions:(AblyFlutterClientOptions *const)options if (!tokenData) { NSLog(@"No token data received %@", tokenData); callback(nil, [NSError errorWithDomain:ARTAblyErrorDomain - code:ARTErrorAuthConfiguredProviderFailure userInfo:nil]); + code:ARTCodeErrorAuthConfiguredProviderFailure userInfo:nil]); } if ([tokenData isKindOfClass:[FlutterError class]]) { NSLog(@"Error getting token data %@", tokenData); callback(nil, tokenData); From 04ff9f21fd6fb6549878e036f6ba1081d07fa7f5 Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:15:55 +0100 Subject: [PATCH 3/8] Update test integration to use latest ably-flutter Podspec --- test_integration/ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_integration/ios/Podfile.lock b/test_integration/ios/Podfile.lock index c5f1837b9..8b172c090 100644 --- a/test_integration/ios/Podfile.lock +++ b/test_integration/ios/Podfile.lock @@ -2,7 +2,7 @@ PODS: - Ably (1.2.6): - AblyDeltaCodec (= 1.3.1) - msgpack (= 0.4.0) - - ably_flutter (0.0.5): + - ably_flutter (1.2.2-preview.1): - Ably (= 1.2.6) - Flutter - AblyDeltaCodec (1.3.1) @@ -27,7 +27,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Ably: 6f58ab63407c71f984ef61112f60525cf9bc634a - ably_flutter: 80537c79ba7cdb1ced594e45c2089bc3ffee1349 + ably_flutter: 8f4fc03a170c13c855e1e78abf6d3e1ade2279aa AblyDeltaCodec: f66a44f743b2a0703f29a65208321d4ea43362d6 Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a msgpack: c85f6251873059738472ae136951cec5f30f3251 From 15012ac6663690969e22013c7e5850a9e16e8397 Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:28:59 +0100 Subject: [PATCH 4/8] Simplify Ably Agent gradle file --- android/ably-agent.gradle | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/android/ably-agent.gradle b/android/ably-agent.gradle index a9662b1b3..b5aac8ad9 100644 --- a/android/ably-agent.gradle +++ b/android/ably-agent.gradle @@ -1,16 +1,14 @@ import java.util.regex.Matcher import java.util.regex.Pattern -String libraryVersion = "" -File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') - -if (pubspec.exists()) { - String yaml = pubspec.text - // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. - Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) - if (versionMatcher.find()) libraryVersion = versionMatcher.group(1).replaceAll("\\+", "-") +String libraryVersion +String yaml = new File(project.projectDir.parentFile, 'pubspec.yaml').text +Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) +if (versionMatcher.find()) { + libraryVersion = versionMatcher.group(1) } + android { defaultConfig { buildConfigField 'String', 'VERSION', "\"${libraryVersion}\"" From ffcb4ccd3d6d2df717202dce9fa6fc776b7c30c6 Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:38:03 +0100 Subject: [PATCH 5/8] Simplify regex to get version from pubspec.yaml --- android/ably-agent.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/ably-agent.gradle b/android/ably-agent.gradle index b5aac8ad9..0ed9ac338 100644 --- a/android/ably-agent.gradle +++ b/android/ably-agent.gradle @@ -3,7 +3,7 @@ import java.util.regex.Pattern String libraryVersion String yaml = new File(project.projectDir.parentFile, 'pubspec.yaml').text -Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) +Matcher versionMatcher = Pattern.compile("^version:\\s*(.*)\$", Pattern.MULTILINE).matcher(yaml) if (versionMatcher.find()) { libraryVersion = versionMatcher.group(1) } From 43e4192518962cd0ee54f29cc2716efea468af86 Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:43:56 +0100 Subject: [PATCH 6/8] Rename `BuildConfig.VERSION` to `BuildConfig.LIBRARY_VERSION` --- android/ably-agent.gradle | 2 +- .../src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/ably-agent.gradle b/android/ably-agent.gradle index 0ed9ac338..8e828bd15 100644 --- a/android/ably-agent.gradle +++ b/android/ably-agent.gradle @@ -11,6 +11,6 @@ if (versionMatcher.find()) { android { defaultConfig { - buildConfigField 'String', 'VERSION', "\"${libraryVersion}\"" + buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersion}\"" } } diff --git a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java index 35f04b1b4..184eafff0 100644 --- a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java +++ b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java @@ -309,7 +309,7 @@ private PlatformClientOptions decodeClientOptions(Map jsonMap) { readValueFromJson(jsonMap, PlatformConstants.TxClientOptions.transportParams, v -> o.transportParams = (Param[]) v); o.agents = new HashMap<>(); - o.agents.put("ably-flutter", BuildConfig.VERSION); + o.agents.put("ably-flutter", BuildConfig.LIBRARY_VERSION); return new PlatformClientOptions(o, jsonMap.containsKey(PlatformConstants.TxClientOptions.hasAuthCallback) ? ((boolean) jsonMap.get(PlatformConstants.TxClientOptions.hasAuthCallback)) : false); } From 73ba1c86c9baf598e6b3bfc1866e4c22c3a0adf5 Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:54:15 +0100 Subject: [PATCH 7/8] Rename LIBRARY_VERSION to DART_PACKAGE_VERSION --- android/ably-agent.gradle | 6 +++--- .../main/java/io/ably/flutter/plugin/AblyMessageCodec.java | 2 +- example/ios/Podfile.lock | 2 +- ios/Classes/codec/AblyFlutterReader.m | 2 +- ios/ably_flutter.podspec | 6 +++--- test_integration/ios/Podfile.lock | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/android/ably-agent.gradle b/android/ably-agent.gradle index 8e828bd15..0570fbab7 100644 --- a/android/ably-agent.gradle +++ b/android/ably-agent.gradle @@ -1,16 +1,16 @@ import java.util.regex.Matcher import java.util.regex.Pattern -String libraryVersion +String dartPackageVersion String yaml = new File(project.projectDir.parentFile, 'pubspec.yaml').text Matcher versionMatcher = Pattern.compile("^version:\\s*(.*)\$", Pattern.MULTILINE).matcher(yaml) if (versionMatcher.find()) { - libraryVersion = versionMatcher.group(1) + dartPackageVersion = versionMatcher.group(1) } android { defaultConfig { - buildConfigField 'String', 'LIBRARY_VERSION', "\"${libraryVersion}\"" + buildConfigField 'String', 'DART_PACKAGE_VERSION', "\"${dartPackageVersion}\"" } } diff --git a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java index 184eafff0..621e6f4c5 100644 --- a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java +++ b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java @@ -309,7 +309,7 @@ private PlatformClientOptions decodeClientOptions(Map jsonMap) { readValueFromJson(jsonMap, PlatformConstants.TxClientOptions.transportParams, v -> o.transportParams = (Param[]) v); o.agents = new HashMap<>(); - o.agents.put("ably-flutter", BuildConfig.LIBRARY_VERSION); + o.agents.put("ably-flutter", BuildConfig.DART_PACKAGE_VERSION); return new PlatformClientOptions(o, jsonMap.containsKey(PlatformConstants.TxClientOptions.hasAuthCallback) ? ((boolean) jsonMap.get(PlatformConstants.TxClientOptions.hasAuthCallback)) : false); } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7ed9385eb..cb98713e6 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -45,7 +45,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Ably: 6f58ab63407c71f984ef61112f60525cf9bc634a - ably_flutter: 8f4fc03a170c13c855e1e78abf6d3e1ade2279aa + ably_flutter: d358af71781496302a5e5dde0590c9075267846d AblyDeltaCodec: f66a44f743b2a0703f29a65208321d4ea43362d6 device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a diff --git a/ios/Classes/codec/AblyFlutterReader.m b/ios/Classes/codec/AblyFlutterReader.m index 4481900e9..5db985402 100644 --- a/ios/Classes/codec/AblyFlutterReader.m +++ b/ios/Classes/codec/AblyFlutterReader.m @@ -145,7 +145,7 @@ use an explicitly received null from Dart (manifesting this side as a nil id) // channelRetryTimeout, transportParams, asyncHttpThreadpoolSize, pushFullWait // track @ https://github.com/ably/ably-flutter/issues/14 - [o addAgent:@"ably-flutter" version: LIBRARY_VERSION]; + [o addAgent:@"ably-flutter" version: DART_PACKAGE_VERSION]; AblyFlutterClientOptions *const co = [AblyFlutterClientOptions new]; ON_VALUE(^(const id value) { diff --git a/ios/ably_flutter.podspec b/ios/ably_flutter.podspec index 52b2b8230..26a7c4128 100644 --- a/ios/ably_flutter.podspec +++ b/ios/ably_flutter.podspec @@ -5,11 +5,11 @@ require 'yaml' pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -library_version = pubspec['version'].gsub('+', '-') +dart_package_version = pubspec['version'].gsub('+', '-') Pod::Spec.new do |s| s.name = 'ably_flutter' - s.version = library_version + s.version = dart_package_version s.summary = 'Ably Cocoa platform support for our Flutter plugin.' s.homepage = 'https://www.ably.com/' s.license = 'Apache 2.0' @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64', - 'GCC_PREPROCESSOR_DEFINITIONS' => "LIBRARY_VERSION=\\@\\\"#{library_version}\\\"" + 'GCC_PREPROCESSOR_DEFINITIONS' => "DART_PACKAGE_VERSION=\\@\\\"#{dart_package_version}\\\"" } s.swift_version = '5.0' end diff --git a/test_integration/ios/Podfile.lock b/test_integration/ios/Podfile.lock index 8b172c090..ef5169483 100644 --- a/test_integration/ios/Podfile.lock +++ b/test_integration/ios/Podfile.lock @@ -27,7 +27,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Ably: 6f58ab63407c71f984ef61112f60525cf9bc634a - ably_flutter: 8f4fc03a170c13c855e1e78abf6d3e1ade2279aa + ably_flutter: d358af71781496302a5e5dde0590c9075267846d AblyDeltaCodec: f66a44f743b2a0703f29a65208321d4ea43362d6 Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a msgpack: c85f6251873059738472ae136951cec5f30f3251 From cba382f45cbd31449a3e2ae1da78d34b3807556d Mon Sep 17 00:00:00 2001 From: Ben Butterworth <24711048+ben-xD@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:58:47 +0100 Subject: [PATCH 8/8] Rename `DART_PACKAGE_VERSION` to `FLUTTER_PACKAGE_PLUGIN_VERSION` --- android/ably-agent.gradle | 2 +- .../main/java/io/ably/flutter/plugin/AblyMessageCodec.java | 2 +- example/ios/Podfile.lock | 2 +- ios/Classes/codec/AblyFlutterReader.m | 2 +- ios/ably_flutter.podspec | 6 +++--- test_integration/ios/Podfile.lock | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/ably-agent.gradle b/android/ably-agent.gradle index 0570fbab7..896d14335 100644 --- a/android/ably-agent.gradle +++ b/android/ably-agent.gradle @@ -11,6 +11,6 @@ if (versionMatcher.find()) { android { defaultConfig { - buildConfigField 'String', 'DART_PACKAGE_VERSION', "\"${dartPackageVersion}\"" + buildConfigField 'String', 'FLUTTER_PACKAGE_PLUGIN_VERSION', "\"${dartPackageVersion}\"" } } diff --git a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java index 621e6f4c5..d81413a4d 100644 --- a/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java +++ b/android/src/main/java/io/ably/flutter/plugin/AblyMessageCodec.java @@ -309,7 +309,7 @@ private PlatformClientOptions decodeClientOptions(Map jsonMap) { readValueFromJson(jsonMap, PlatformConstants.TxClientOptions.transportParams, v -> o.transportParams = (Param[]) v); o.agents = new HashMap<>(); - o.agents.put("ably-flutter", BuildConfig.DART_PACKAGE_VERSION); + o.agents.put("ably-flutter", BuildConfig.FLUTTER_PACKAGE_PLUGIN_VERSION); return new PlatformClientOptions(o, jsonMap.containsKey(PlatformConstants.TxClientOptions.hasAuthCallback) ? ((boolean) jsonMap.get(PlatformConstants.TxClientOptions.hasAuthCallback)) : false); } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index cb98713e6..0a2aa3ac4 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -45,7 +45,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Ably: 6f58ab63407c71f984ef61112f60525cf9bc634a - ably_flutter: d358af71781496302a5e5dde0590c9075267846d + ably_flutter: 5dbbb85679f473af0eb56536d2041fadeb9308eb AblyDeltaCodec: f66a44f743b2a0703f29a65208321d4ea43362d6 device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a diff --git a/ios/Classes/codec/AblyFlutterReader.m b/ios/Classes/codec/AblyFlutterReader.m index 5db985402..1bc28eb59 100644 --- a/ios/Classes/codec/AblyFlutterReader.m +++ b/ios/Classes/codec/AblyFlutterReader.m @@ -145,7 +145,7 @@ use an explicitly received null from Dart (manifesting this side as a nil id) // channelRetryTimeout, transportParams, asyncHttpThreadpoolSize, pushFullWait // track @ https://github.com/ably/ably-flutter/issues/14 - [o addAgent:@"ably-flutter" version: DART_PACKAGE_VERSION]; + [o addAgent:@"ably-flutter" version: FLUTTER_PACKAGE_PLUGIN_VERSION]; AblyFlutterClientOptions *const co = [AblyFlutterClientOptions new]; ON_VALUE(^(const id value) { diff --git a/ios/ably_flutter.podspec b/ios/ably_flutter.podspec index 26a7c4128..9b2e881a3 100644 --- a/ios/ably_flutter.podspec +++ b/ios/ably_flutter.podspec @@ -5,11 +5,11 @@ require 'yaml' pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) -dart_package_version = pubspec['version'].gsub('+', '-') +flutter_package_plugin_version = pubspec['version'].gsub('+', '-') Pod::Spec.new do |s| s.name = 'ably_flutter' - s.version = dart_package_version + s.version = flutter_package_plugin_version s.summary = 'Ably Cocoa platform support for our Flutter plugin.' s.homepage = 'https://www.ably.com/' s.license = 'Apache 2.0' @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64', - 'GCC_PREPROCESSOR_DEFINITIONS' => "DART_PACKAGE_VERSION=\\@\\\"#{dart_package_version}\\\"" + 'GCC_PREPROCESSOR_DEFINITIONS' => "FLUTTER_PACKAGE_PLUGIN_VERSION=\\@\\\"#{flutter_package_plugin_version}\\\"" } s.swift_version = '5.0' end diff --git a/test_integration/ios/Podfile.lock b/test_integration/ios/Podfile.lock index ef5169483..757e33c80 100644 --- a/test_integration/ios/Podfile.lock +++ b/test_integration/ios/Podfile.lock @@ -27,7 +27,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Ably: 6f58ab63407c71f984ef61112f60525cf9bc634a - ably_flutter: d358af71781496302a5e5dde0590c9075267846d + ably_flutter: 5dbbb85679f473af0eb56536d2041fadeb9308eb AblyDeltaCodec: f66a44f743b2a0703f29a65208321d4ea43362d6 Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a msgpack: c85f6251873059738472ae136951cec5f30f3251