Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updated at_notify_flutter to version 1.0.10 #878

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/at_notify_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
## 1.0.10

- **FIX**: Resolved Static analysis messages
- **FIX**: Lint issues fixed
- **CHORE**: Updated dependencies
- **CHORE**: Updated kotlin version number
- **FIX**: Updated AndroidInitializationSettings string to'@mipmap/ic_launcher'

## 1.0.9:

- **CHORE**: Major version increase of at_commons from ^3.0.55 to ^4.0.1

## 1.0.8

- **CHORE**: Bumped all dependency versions
- Major version increase of flutter_local_notifications from ^14.1.1 to ^15.1.1

## 1.0.7

- **CHORE**: Improved pub score

## 1.0.6

- **CHORE**: Updated dependency

## 1.0.5

- **FIX**: Lint Fixes according to flutter 3.0

## 1.0.4

- **CHORE**: Updated dependencies
- **DOCS**: Updated documentation

## 1.0.3

- **CHORE**: Updated dependencies

## 1.0.2

- **CHORE**: Updated example with at_app_skeleton
- **DOCS**: Updated README.md and EXAMPLE.md

## 1.0.1

- **FIX**: Fixed at_client dependency issue. Removed reference to deprecated SyncStrategy

## 1.0.0

- Initial version
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.at_notify_flutter_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.at_notify_flutter_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="at_notify_flutter_example" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
4 changes: 2 additions & 2 deletions packages/at_notify_flutter/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.20'
repositories {
google()
mavenCentral()
Expand All @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

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

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
26 changes: 13 additions & 13 deletions packages/at_notify_flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.1.1):
- permission_handler_apple (9.3.0):
- Flutter
- qr_code_scanner (0.2.0):
- Flutter
Expand Down Expand Up @@ -152,26 +152,26 @@ SPEC CHECKSUMS:
at_notify_flutter: 9881d230ac220d5f02cbc71cc07113457996838e
at_onboarding_flutter: e8219b6d0bfb236d3837ec3528871aebdcc56e8d
biometric_storage: 1400f1382af3a4cc2bf05340e13c3d8de873ceb9
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de
file_selector_ios: 8c25d700d625e1dcdd6599f2d927072f2254647b
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
file_selector_ios: f0670c1064a8c8450e38145d8043160105d0b97c
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_keychain: 01aabf894ffe8b01adfda1d9df21c210c1b4b452
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

COCOAPODS: 1.12.1
COCOAPODS: 1.14.3
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
976928F52F649FDD3071E610 /* [CP] Embed Pods Frameworks */,
9AA412A02A75441479BD35D9 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -156,7 +157,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -246,6 +247,23 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9AA412A02A75441479BD35D9 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
AE120CBA9124676DCB5CD5EE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -343,7 +361,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -361,7 +379,10 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.atNotifyFlutterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -417,7 +438,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -466,7 +487,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -485,7 +506,10 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.atNotifyFlutterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -504,7 +528,10 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.atNotifyFlutterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
42 changes: 15 additions & 27 deletions packages/at_notify_flutter/lib/services/notify_service.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/// A service to handle save and retrieve operation on notify

// ignore_for_file: avoid_print

import 'dart:async';
import 'dart:io';

import 'package:at_client/at_client.dart';
import 'package:at_client_mobile/at_client_mobile.dart';
import 'package:at_notify_flutter/models/notify_model.dart';
import 'package:at_notify_flutter/utils/notify_utils.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';

/// A service to handle save and retrieve operation on notify
class NotifyService {
NotifyService._();

Expand All @@ -33,8 +33,7 @@ class NotifyService {
List<Notify> notifies = [];

/// Stream to put the notification object list
StreamController<List<Notify>> notifyStreamController =
StreamController<List<Notify>>.broadcast();
StreamController<List<Notify>> notifyStreamController = StreamController<List<Notify>>.broadcast();

Sink get notifySink => notifyStreamController.sink;

Expand All @@ -45,23 +44,19 @@ class NotifyService {
}

/// Initialise function to set the client preference, atsign and root domain
void initNotifyService(
AtClientPreference atClientPreference,
String currentAtSignFromApp,
String rootDomainFromApp,
void initNotifyService(AtClientPreference atClientPreference, String currentAtSignFromApp, String rootDomainFromApp,
int rootPortFromApp) async {
currentAtSign = currentAtSignFromApp;
rootDomain = rootDomainFromApp;
rootPort = rootPortFromApp;
atClientManager = AtClientManager.getInstance();
AtClientManager.getInstance().setCurrentAtSign(
currentAtSignFromApp, atClientPreference.namespace, atClientPreference);
AtClientManager.getInstance()
.setCurrentAtSign(currentAtSignFromApp, atClientPreference.namespace, atClientPreference);
atClient = AtClientManager.getInstance().atClient;
_notificationsPlugin = FlutterLocalNotificationsPlugin();

atClientManager.atClient.notificationService
.subscribe(
regex: '.${atClientPreference.namespace}', shouldDecrypt: true)
.subscribe(regex: '.${atClientPreference.namespace}', shouldDecrypt: true)
.listen((AtNotification notification) {
_notificationCallback(notification);
});
Expand All @@ -74,8 +69,7 @@ class NotifyService {

/// Initialized Notification Settings
initializePlatformSpecifics() async {
var initializationSettingsAndroid =
const AndroidInitializationSettings('ic_launcher');
var initializationSettingsAndroid = const AndroidInitializationSettings('@mipmap/ic_launcher');
var initializationSettingsIOS = DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
Expand All @@ -91,8 +85,8 @@ class NotifyService {
// didReceivedLocalNotificationSubject.add(receivedNotification);
},
);
initializationSettings = InitializationSettings(
android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
initializationSettings =
InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);

await _notificationsPlugin.initialize(
initializationSettings,
Expand All @@ -102,8 +96,7 @@ class NotifyService {
/// Request Alert, Badge, Sound Permission for IOS
_requestIOSPermission() {
_notificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()!
.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()!
.requestPermissions(
alert: false,
badge: true,
Expand Down Expand Up @@ -181,9 +174,7 @@ class NotifyService {
}

/// Call Notify in NotificationService, send notify to others
Future<bool> sendNotify(
String sendToAtSign, Notify notify, NotifyEnum notifyType,
{int noOfDays = 30}) async {
Future<bool> sendNotify(String sendToAtSign, Notify notify, NotifyEnum notifyType, {int noOfDays = 30}) async {
if (!sendToAtSign.contains('@')) {
sendToAtSign = '@$sendToAtSign';
}
Expand All @@ -195,13 +186,11 @@ class NotifyService {
..sharedBy = currentAtSign
..sharedWith = sendToAtSign
..metadata = metadata;
var notificationResponse =
await atClientManager.atClient.notificationService.notify(
var notificationResponse = await atClientManager.atClient.notificationService.notify(
NotificationParams.forUpdate(key, value: notify.toJson()),
);

if (notificationResponse.notificationStatusEnum ==
NotificationStatusEnum.delivered) {
if (notificationResponse.notificationStatusEnum == NotificationStatusEnum.delivered) {
print(notificationResponse.toString());
} else {
print(notificationResponse.atClientException.toString());
Expand All @@ -227,8 +216,7 @@ class NotifyService {
);
var iosChannelSpecifics = const DarwinNotificationDetails();

var platformChannelSpecifics = NotificationDetails(
android: androidChannelSpecifics, iOS: iosChannelSpecifics);
var platformChannelSpecifics = NotificationDetails(android: androidChannelSpecifics, iOS: iosChannelSpecifics);
await _notificationsPlugin.show(
0,
atSign,
Expand Down
Loading