Skip to content

Commit

Permalink
fix(PushPushGoSdkPlugin): async completion handler fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amarose committed Nov 12, 2024
1 parent 288404c commit 7abc69d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ Fix ios sdk versioning
Add PPG.registerNotificationsDeliveredFromUserInfo() into PushPushGoSdkPlugin.swift

## 1.0.4
Pre release test version for fixing delivery events on app killed
Pre release test version for fixing delivery events on app killed

## 1.1.0
Fix async completion handler issue in PPG.registerNotificationsDeliveredFromUserInfo()
Fix delivered event issue
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Flutter (1.0.0)
- PPG_framework (2.0.2)
- pushpushgo_sdk (1.0.4):
- pushpushgo_sdk (1.1.0):
- Flutter
- PPG_framework

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.4"
version: "1.1.0"
sky_engine:
dependency: transitive
description: flutter
Expand Down
7 changes: 4 additions & 3 deletions ios/Classes/PushpushgoSdkPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class PushpushgoSdkPlugin: NSObject, FlutterPlugin, FlutterApplicationLif
}
}

public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable: Any] = [:]) -> Bool {
self.application = application;
return true
}
Expand Down Expand Up @@ -214,12 +214,13 @@ public class PushpushgoSdkPlugin: NSObject, FlutterPlugin, FlutterApplicationLif
}
}

public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) -> Bool {
print("didReceiveRemoteNotification")
PPG.registerNotificationDeliveredFromUserInfo(userInfo: userInfo) { status in
print(status);
}
completionHandler(.newData)
}
return true
}

// Works only on UIKit on SwiftUI it can be done onChange()
Expand Down
4 changes: 2 additions & 2 deletions ios/pushpushgo_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'pushpushgo_sdk'
s.version = '1.0.4'
s.version = '1.1.0'
s.summary = 'PushPushGo SDK'
s.description = <<-DESC
PushPushGo SDK for Flutter (Dart)
Expand All @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'PPG_framework', '~> 2.0.2'
s.dependency 'PPG_framework'
s.platform = :ios, '14.0'

# Flutter.framework does not contain a i386 slice.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pushpushgo_sdk
description: PushPushGo SDK for Flutter
version: 1.0.4
version: 1.1.0
repository: https://github.com/ppgco/flutter-sdk

environment:
Expand Down

0 comments on commit 7abc69d

Please sign in to comment.