Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ably/ably-flutter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.9
Choose a base ref
...
head repository: ably/ably-flutter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.2.10
Choose a head ref

Commits on Nov 23, 2021

  1. Explicitly check types of tokenDetails, instead of using macro which …

    …doesn't handle `NSNull` case
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    8d35565 View commit details
  2. Copy the full SHA
    783da05 View commit details
  3. Run flutter format .

    ben-xD committed Nov 23, 2021
    Copy the full SHA
    592a42b View commit details
  4. Merge branch 'bug/ios/crashing-when-clientid-is-not-set' into enhance…

    …ment/ios/linter-warning
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    3ceda28 View commit details
  5. Copy the full SHA
    0a8f64a View commit details
  6. Merge branch 'enhancement/simplify-auth-callback-state' into bug/ios/…

    …crashing-when-clientid-is-not-set
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    3958c89 View commit details
  7. Merge branch 'bug/ios/crashing-when-clientid-is-not-set' into enhance…

    …ment/ios/linter-warning
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    3699947 View commit details
  8. Merge branch 'enhancement/simplify-auth-callback-state' into bug/ios/…

    …crashing-when-clientid-is-not-set
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    eb0f663 View commit details
  9. Merge branch 'bug/ios/crashing-when-clientid-is-not-set' into enhance…

    …ment/ios/linter-warning
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    31e0858 View commit details
  10. Merge branch 'enhancement/simplify-auth-callback-state' into bug/ios/…

    …crashing-when-clientid-is-not-set
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    6aed181 View commit details
  11. Merge branch 'bug/ios/crashing-when-clientid-is-not-set' into enhance…

    …ment/ios/linter-warning
    ben-xD committed Nov 23, 2021
    Copy the full SHA
    f7a5125 View commit details

Commits on Nov 24, 2021

  1. Copy the full SHA
    ed3851f View commit details

Commits on Nov 25, 2021

  1. Copy the full SHA
    29840f8 View commit details
  2. Copy the full SHA
    f0f77d1 View commit details
  3. Copy the full SHA
    7c8e8e8 View commit details

Commits on Nov 26, 2021

  1. Merge remote-tracking branch 'origin/enhancement/package-descriptions…

    …' into enhancement/ios/linter-warning
    ben-xD committed Nov 26, 2021
    Copy the full SHA
    07df1fa View commit details
  2. Revert "Rename unhelpful variable names"

    This reverts commit ed3851f.
    ben-xD committed Nov 26, 2021
    Copy the full SHA
    4df4cbe View commit details
  3. Copy the full SHA
    33d4eba View commit details

Commits on Nov 29, 2021

  1. WIP: Release channel fix

    ben-xD committed Nov 29, 2021
    Copy the full SHA
    642d2b6 View commit details
  2. Copy the full SHA
    639b6ec View commit details

Commits on Dec 8, 2021

  1. Merge pull request #252 from ably/enhancement/ios/linter-warning

    Remove ON_VALUE usage because `hasAuthCallback` is always set
    ben-xD authored Dec 8, 2021
    Copy the full SHA
    2ea439e View commit details

Commits on Dec 13, 2021

  1. Add documentation about actions required to make Ably Flutter push wo…

    …rk across environments
    ben-xD committed Dec 13, 2021
    Copy the full SHA
    2491ede View commit details

Commits on Jan 5, 2022

  1. Merge branch 'main' into enhancement/package-descriptions

    # Conflicts:
    #	ios/Classes/codec/AblyFlutterReader.m
    #	pubspec.yaml
    ikbalkaya committed Jan 5, 2022
    Copy the full SHA
    8af11e6 View commit details

Commits on Jan 19, 2022

  1. Copy the full SHA
    bd8757a View commit details
  2. Copy the full SHA
    850d474 View commit details
  3. Copy the full SHA
    f50bde8 View commit details
  4. Copy the full SHA
    e693f7e View commit details
  5. Merge pull request #261 from ably/enhancement/package-descriptions

    Emphasize Ably product in descriptions (pubspec, readme)
    QuintinWillison authored Jan 19, 2022
    Copy the full SHA
    85e06a3 View commit details
  6. Merge branch 'main' into enhancement/variable-renames

    # Conflicts:
    #	ios/Classes/codec/AblyFlutterReader.m
    QuintinWillison committed Jan 19, 2022
    Copy the full SHA
    2fb18c6 View commit details
  7. Merge pull request #262 from ably/enhancement/variable-renames

    Rename variables to be more meaningful
    QuintinWillison authored Jan 19, 2022
    Copy the full SHA
    8cf46f1 View commit details
  8. Merge pull request #280 from ably/enhancement/documentation-for-activ…

    …ation-on-different-environments
    
    Add documentation about actions required to make Ably Flutter push work across multiple environments
    QuintinWillison authored Jan 19, 2022
    Copy the full SHA
    106d034 View commit details
  9. Merge branch 'main' into bug/release-channel

    # Conflicts:
    #	example/lib/ui/realtime_sliver.dart
    QuintinWillison committed Jan 19, 2022
    Copy the full SHA
    024e16b View commit details
  10. Merge pull request #265 from ably/bug/release-channel

    Example app: "release" channel button
    QuintinWillison authored Jan 19, 2022
    Copy the full SHA
    f40d5a5 View commit details

Commits on Jan 20, 2022

  1. Bump the ably-cocoa dependency to latest, version 1.2.9.

    I tried to follow the steps that had worked for me a few days ago, as detailed in the opening comment here:
    #293
    
    However, I got some odd CocoaPods errors. I ended up following these instructions (it's `trunk`) which got me there for the example directory but was still failing for test_integration:
    https://stackoverflow.com/a/34526412/392847
    
    So, I ended up picking the changes that the pod tool had applied to the lock file in the example directory and manually transferring those over to the test_integration lock file.
    Not ideal - so there's more to be understood here as this is not sustainable.
    QuintinWillison committed Jan 20, 2022
    Copy the full SHA
    29a15b7 View commit details
  2. Merge pull request #299 from ably/feature/ably-cocoa-1.2.9

    Update to `ably-cocoa` v.1.2.9
    QuintinWillison authored Jan 20, 2022
    Copy the full SHA
    96f294b View commit details
  3. Bump version (patch).

    Steps completed to achieve this:
    1. Manually modified root `version` field in `pubspec.yaml`
    2. Ran `flutter pub get` from root folder
    3. Ran `flutter pub get` from `example` folder
    4. Ran `flutter pub get` from `test_integration` folder
    5. Ran `pod install --repo-update` from `example/ios` folder
    6. Ran `pod install --repo-update` from `test_integration/ios` folder
    QuintinWillison committed Jan 20, 2022
    Copy the full SHA
    d04fc46 View commit details
  4. Add full output from the changelog generator tool.

    via:
    github_changelog_generator -u ably -p ably-flutter --since-tag v1.2.9 --output delta.md
    QuintinWillison committed Jan 20, 2022
    Copy the full SHA
    f5578c0 View commit details
  5. Reformat and thin out the change log entry to include only the inform…

    …ation that is important to end users.
    QuintinWillison committed Jan 20, 2022
    Copy the full SHA
    728a35d View commit details
  6. Merge pull request #300 from ably/release/1.2.10

    Release/1.2.10
    QuintinWillison authored Jan 20, 2022
    Copy the full SHA
    22a1d3b View commit details
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [1.2.10](https://github.com/ably/ably-flutter/tree/v1.2.10)

[Full Changelog](https://github.com/ably/ably-flutter/compare/v1.2.9...v1.2.10)

**Bug Fix:**

This bug affects customers using
[message content encryption](https://ably.com/documentation/realtime/encryption)
alongisde
[channel history](https://ably.com/documentation/rest/history)
for a single Ably client instance.
It only affects the iOS runtime (not an issue on Android).
History REST requests, on iOS only, were incorrectly returning encrypted payloads,
despite encryption having been enabled via the Realtime channel `setOptions` API.

- **Bug**: Updating Realtime channel options doesn’t update the options of its REST counterpart [\#296](https://github.com/ably/ably-flutter/issues/296), caused by [ably/ably-cocoa\#1265](https://github.com/ably/ably-cocoa/issues/1265)
- **Fix**: Update to `ably-cocoa` v.1.2.9 [\#299](https://github.com/ably/ably-flutter/pull/299) ([QuintinWillison](https://github.com/QuintinWillison)), using [ably/ably-cocoa\#1266](https://github.com/ably/ably-cocoa/pull/1266) ([lawrence-forooghian](https://github.com/lawrence-forooghian))

## [1.2.9](https://github.com/ably/ably-flutter/tree/v1.2.9)

[Full Changelog](https://github.com/ably/ably-flutter/compare/v1.2.8...v1.2.9)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ Differences between Ably Flutter and Firebase Messaging implementation (Android
- **Resource consumption tradeoffs:** Firebase launches an isolate capable of only handling messages at app launch, even if users' application isn't handling remote messages. Firebase Messaging keeps this isolate running throughout the app, and have a queue process to queue messages by maintaining an Android Service. This allows 10 minutes of execution time, where as on iOS, Firebase Messaging only has 30 seconds of execution time. Instead, Ably Flutter launches a new isolate on every message if the application is not yet running and avoids creating a service and queueing work. A new message will spawn a new engine.
- **Execution time:** Ably Flutter provides users with an execution time of 30 seconds on both Android and iOS to handle each message. On Android, Firebase messaging launches a Service which has [approximately 10 minutes](https://stackoverflow.com/questions/48630606/how-long-is-the-jobservice-execution-time-limit-mentioned-in-androids-jobinte) of execution time from it's launch to handle all messages received before Android stops the service. It's unclear if the Service will be automatically launched by iOS immediately, or if it will only be launched in the future. On iOS, each message has 30 seconds of execution time. This seems to be a bug in the design of firebase_messaging. Users can extend their execution time by using [package:workmanager](https://pub.dev/packages/workmanager).

Because of this architectural simplicity, Ably Flutter does not need to use [`PluginUtilies`](https://stackoverflow.com/questions/69208164/what-does-pluginutilities-do-in-flutters-dartui-library-and-how-do-i-use/69208165#69208165), pass references of two methods between Dart and host platform, or save and load these methods in `SharedPreferences`. Ably Flutter avoids conflicts between the default `FlutterEngine` launched with a `FlutterActivity` and the one manually launched in the `BroadcastReceiver`, by using method channels with unique channel names.
Because of this architectural simplicity, Ably Flutter does not need to use [`PluginUtilities`](https://stackoverflow.com/questions/69208164/what-does-pluginutilities-do-in-flutters-dartui-library-and-how-do-i-use/69208165#69208165), pass references of two methods between Dart and host platform, or save and load these methods in `SharedPreferences`. Ably Flutter avoids conflicts between the default `FlutterEngine` launched with a `FlutterActivity` and the one manually launched in the `BroadcastReceiver`, by using method channels with unique channel names.

## Platform Notes

3 changes: 3 additions & 0 deletions PushNotifications.md
Original file line number Diff line number Diff line change
@@ -89,6 +89,9 @@ If you invoke any methods from the `ably_flutter` package before calling `runApp
- Activate the device for push notifications with Ably: `ablyClient.push.activate();`. This only
needs to be done once, and will be used across all future app launches, as long as the app is not deactivated. This method will throw an AblyException if it fails.
- The `Future` returned by `activate` is not guaranteed to complete quickly. For example, if there is no internet connection, `activate` will wait until it is available. Therefore, there is no guarantee any code awaiting the completion of the `Future` will run.
- When moving between different environments (e.g. development vs. production), you should clear the push device information stored by Ably Flutter to avoid using the wrong push device information on a different environment, by either:
- Reinstalling your app, or
- Deactivating the device in the same environment the device was activated on.

```dart
try {
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,17 +4,12 @@
[![.github/workflows/docs.yml](https://github.com/ably/ably-flutter/actions/workflows/docs.yml/badge.svg)](https://github.com/ably/ably-flutter/actions/workflows/docs.yml)
[![.github/workflows/flutter_integration.yaml](https://github.com/ably/ably-flutter/actions/workflows/flutter_integration.yaml/badge.svg)](https://github.com/ably/ably-flutter/actions/workflows/flutter_integration.yaml)

A
[Flutter](https://flutter.dev/)
plugin wrapping the
[ably-cocoa](https://github.com/ably/ably-cocoa) (iOS)
and
[ably-java](https://github.com/ably/ably-java) (Android)
client library SDKs for [Ably](https://www.ably.com),
the platform that powers synchronized digital experiences in realtime.

Ably provides the best infrastructure and APIs to power realtime experiences at scale, delivering billions of realtime messages everyday to millions of end users.
We handle the complexity of realtime messaging so you can focus on your code.
_[Ably](https://ably.com) is the platform that powers synchronized digital experiences in realtime. Whether attending an event in a virtual venue, receiving realtime financial information, or monitoring live car performance data – consumers simply expect realtime digital experiences as standard. Ably provides a suite of APIs to build, extend, and deliver powerful digital experiences in realtime for more than 250 million devices across 80 countries each month. Organizations like Bloomberg, HubSpot, Verizon, and Hopin depend on Ably’s platform to offload the growing complexity of business-critical realtime data synchronization at global scale. For more information, see the [Ably documentation](https://ably.com/documentation)._

## Overview

A [Flutter](https://flutter.dev/) plugin for [Ably](https://www.ably.com),
built on top of Ably's [iOS](https://github.com/ably/ably-cocoa) and [Android](https://github.com/ably/ably-java) SDKs.

## Resources

10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- Ably (1.2.8):
- Ably (1.2.9):
- AblyDeltaCodec (= 1.3.2)
- msgpack (= 0.4.0)
- ably_flutter (1.2.9):
- Ably (= 1.2.8)
- ably_flutter (1.2.10):
- Ably (= 1.2.9)
- Flutter
- AblyDeltaCodec (1.3.2)
- device_info_plus (0.0.1):
@@ -44,8 +44,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttertoast/ios"

SPEC CHECKSUMS:
Ably: f5de469bc7b0804cb11b6b5c4c9c76e9ee5991db
ably_flutter: d1a0c66062673b8aa8a3b25151862d276fa99bdb
Ably: 7a28ee5c71f31d415a767e72b3f56e5918537d16
ably_flutter: eb447a2905d92c26ff15f61929cfe3b935f13745
AblyDeltaCodec: 783d017270de70bbbc0a84e4235297b225d33636
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
64 changes: 41 additions & 23 deletions example/lib/ui/realtime_sliver.dart
Original file line number Diff line number Diff line change
@@ -13,19 +13,21 @@ import 'package:flutter_hooks/flutter_hooks.dart';

class RealtimeSliver extends HookWidget {
final AblyService ablyService;
late final ably.Realtime realtime;
late final ably.RealtimeChannel channel;
final List<StreamSubscription> _subscriptions = [];
final ably.Realtime realtime;
late ably.RealtimeChannel channel;
List<StreamSubscription> _subscriptions = [];

RealtimeSliver(this.ablyService, {Key? key}) : super(key: key) {
realtime = ablyService.realtime;
RealtimeSliver(this.ablyService, {Key? key})
: realtime = ablyService.realtime,
super(key: key) {
channel = realtime.channels.get(Constants.channelName);
}

void dispose() {
for (final subscription in _subscriptions) {
subscription.cancel();
}
_subscriptions = [];
}

Widget buildConnectButton() => TextButton(
@@ -130,8 +132,16 @@ class RealtimeSliver extends HookWidget {
),
);

Widget buildReleaseRealtimeChannelButton() => TextButton(
onPressed: () => realtime.channels.release(Constants.channelName),
Widget buildReleaseRealtimeChannelButton(
ValueNotifier<ably.ConnectionState> connectionState,
ValueNotifier<ably.ChannelState> channelState) =>
TextButton(
onPressed: () async {
await channel.detach();
realtime.channels.release(Constants.channelName);
channel = realtime.channels.get(Constants.channelName);
setupListeners(connectionState, channelState);
},
child: const Text('Release'),
);

@@ -145,21 +155,7 @@ class RealtimeSliver extends HookWidget {
useState<StreamSubscription<ably.Message>?>(null);

useEffect(() {
final connectionSubscription =
realtime.connection.on().listen((connectionStateChange) {
if (connectionStateChange.current == ably.ConnectionState.failed) {
logAndDisplayError(connectionStateChange.reason);
}
connectionState.value = connectionStateChange.current;
print('${DateTime.now()}:'
' ConnectionStateChange event: ${connectionStateChange.event}'
' with reason: ${connectionStateChange.reason}');
});
_subscriptions.add(connectionSubscription);
final channelSubscription = channel.on().listen((stateChange) {
channelState.value = channel.state;
});
_subscriptions.add(channelSubscription);
setupListeners(connectionState, channelState);
return dispose;
}, []);

@@ -192,7 +188,9 @@ class RealtimeSliver extends HookWidget {
child: buildChannelAttachButton(
connectionState.value, channelState.value)),
Expanded(child: buildChannelDetachButton(channelState.value)),
Expanded(child: buildReleaseRealtimeChannelButton()),
Expanded(
child: buildReleaseRealtimeChannelButton(
connectionState, channelState)),
],
),
Row(
@@ -252,6 +250,26 @@ class RealtimeSliver extends HookWidget {
],
);
}

void setupListeners(ValueNotifier<ably.ConnectionState> connectionState,
ValueNotifier<ably.ChannelState> channelState) {
dispose();
final connectionSubscription =
realtime.connection.on().listen((connectionStateChange) {
if (connectionStateChange.current == ably.ConnectionState.failed) {
logAndDisplayError(connectionStateChange.reason);
}
connectionState.value = connectionStateChange.current;
print('${DateTime.now()}:'
' ConnectionStateChange event: ${connectionStateChange.event}'
'\nReason: ${connectionStateChange.reason}');
});
_subscriptions.add(connectionSubscription);
final channelSubscription = channel.on().listen((stateChange) {
channelState.value = channel.state;
});
_subscriptions.add(channelSubscription);
}
}

List<dynamic> _messagesToPublish = [
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.9"
version: "1.2.10"
args:
dependency: transitive
description:
2 changes: 1 addition & 1 deletion ios/Classes/AblyFlutter.m
Original file line number Diff line number Diff line change
@@ -582,7 +582,7 @@ -(void)reset;
message:[NSString stringWithFormat:@"Error getting first page; err = %@", [error message]]
details:error
]);
}else{
} else {
NSNumber *const paginatedResultHandle = [instanceStore setPaginatedResult:paginatedResult handle:handle];
result([[AblyFlutterMessage alloc] initWithMessage:paginatedResult handle: paginatedResultHandle]);
}
Loading