Skip to content
Open
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
4 changes: 4 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ jobs:
sed -i '' "s|s.dependency 'OneSignalXCFramework', '[^']*'|s.dependency 'OneSignalXCFramework', '${VERSION}'|" ios/onesignal_flutter.podspec
echo "✓ Updated ios/onesignal_flutter.podspec with iOS SDK ${VERSION}"

# Update Package.swift with new version (for SPM)
sed -i '' "s|OneSignal-XCFramework\", exact: \"[^\"]*\"|OneSignal-XCFramework\", exact: \"${VERSION}\"|" ios/onesignal_flutter/Package.swift
echo "✓ Updated ios/onesignal_flutter/Package.swift with iOS SDK ${VERSION}"

# Update ios example
cd example/ios
pod update OneSignalXCFramework
Expand Down
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,3 @@ dlcov.log
*.ipr
*.iws
.idea/

# Swift Package Manager
**/.build/
**/.swiftpm/
**/Package.resolved
**/.lock
**/workspace-state.json
11 changes: 11 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ dlcov.log
pubspec.lock
.flutter-plugins-dependencies
flutter_export_environment.sh
analysis_options.yaml

# Misc
CODEOWNERS
CONTRIBUTING.md
MIGRATION_GUIDE.md

# Examples
example
example_pod
example_spm
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
analyzer:
exclude:
- test/dlcov_references_test.dart
- example/**
- example_pod/**
- example_spm/**
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
</dict>
<key>NSSupportsLiveActivities</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to send relevant notifications.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
27 changes: 24 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class _MyAppState extends State<MyApp> {
String? _language;
String? _liveActivityId;
bool _enableConsentButton = false;
bool _locationShared = false;

// CHANGE THIS parameter to true if you want to test GDPR privacy consent
bool _requireConsent = false;
Expand Down Expand Up @@ -197,8 +198,20 @@ class _MyAppState extends State<MyApp> {
}

void _handleSetLocationShared() {
print("Setting location shared to true");
OneSignal.Location.setShared(true);
_locationShared = !_locationShared;
print("Setting location shared to $_locationShared");
OneSignal.Location.setShared(_locationShared);
setState(() {});
}

void _handleRequestLocationPermission() {
print("Requesting location permission");
OneSignal.Location.requestPermission();
}

void _handleIsLocationShared() async {
var isShared = await OneSignal.Location.isShared();
print('Location shared: $isShared');
}

void _handleGetExternalId() async {
Expand Down Expand Up @@ -394,9 +407,17 @@ class _MyAppState extends State<MyApp> {
_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Set Location Shared",
new OneSignalButton("Location Shared: $_locationShared",
_handleSetLocationShared, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Request Location",
_handleRequestLocationPermission, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Is Location Shared",
_handleIsLocationShared, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton(
"Remove Tag", _handleRemoveTag, !_enableConsentButton)
Expand Down
2 changes: 2 additions & 0 deletions example_pod/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
</dict>
<key>NSSupportsLiveActivities</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to send relevant notifications.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
27 changes: 24 additions & 3 deletions example_pod/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class _MyAppState extends State<MyApp> {
String? _language;
String? _liveActivityId;
bool _enableConsentButton = false;
bool _locationShared = false;

// CHANGE THIS parameter to true if you want to test GDPR privacy consent
bool _requireConsent = false;
Expand Down Expand Up @@ -197,8 +198,20 @@ class _MyAppState extends State<MyApp> {
}

void _handleSetLocationShared() {
print("Setting location shared to true");
OneSignal.Location.setShared(true);
_locationShared = !_locationShared;
print("Setting location shared to $_locationShared");
OneSignal.Location.setShared(_locationShared);
setState(() {});
}

void _handleRequestLocationPermission() {
print("Requesting location permission");
OneSignal.Location.requestPermission();
}

void _handleIsLocationShared() async {
var isShared = await OneSignal.Location.isShared();
print('Location shared: $isShared');
}

void _handleGetExternalId() async {
Expand Down Expand Up @@ -394,9 +407,17 @@ class _MyAppState extends State<MyApp> {
_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Set Location Shared",
new OneSignalButton("Location Shared: $_locationShared",
_handleSetLocationShared, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Request Location",
_handleRequestLocationPermission, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Is Location Shared",
_handleIsLocationShared, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton(
"Remove Tag", _handleRemoveTag, !_enableConsentButton)
Expand Down
2 changes: 2 additions & 0 deletions example_spm/ios/ExampleWidget/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSSupportsLiveActivities</key>
<true/>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
18 changes: 0 additions & 18 deletions example_spm/ios/Flutter/Flutter.podspec

This file was deleted.

38 changes: 28 additions & 10 deletions example_spm/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
CA2C87F221015A8D00D5D35D /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2C87F121015A8C00D5D35D /* UserNotifications.framework */; };
CAB34E9320F96BDA0024CA6B /* NotificationService.m in Sources */ = {isa = PBXBuildFile; fileRef = CAB34E9220F96BDA0024CA6B /* NotificationService.m */; };
CAB34E9D20F96F460024CA6B /* OneSignalNotificationServiceExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = CAB34E8F20F96BDA0024CA6B /* OneSignalNotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
E82451E52F0F38F80032825E /* OneSignalFramework in Frameworks */ = {isa = PBXBuildFile; productRef = E82451E42F0F38F80032825E /* OneSignalFramework */; };
E82451E72F0F39250032825E /* OneSignalFramework in Frameworks */ = {isa = PBXBuildFile; productRef = E82451E62F0F39250032825E /* OneSignalFramework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -112,6 +114,7 @@
buildActionMask = 2147483647;
files = (
47CD9D272BE10D9400F8B006 /* SwiftUI.framework in Frameworks */,
E82451E72F0F39250032825E /* OneSignalFramework in Frameworks */,
47CD9D252BE10D9400F8B006 /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -128,6 +131,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E82451E52F0F38F80032825E /* OneSignalFramework in Frameworks */,
CA2C87F221015A8D00D5D35D /* UserNotifications.framework in Frameworks */,
CA2C87DC21014E1C00D5D35D /* UIKit.framework in Frameworks */,
CA2C87DA21014E1800D5D35D /* SystemConfiguration.framework in Frameworks */,
Expand Down Expand Up @@ -169,7 +173,6 @@
47CD9D282BE10D9400F8B006 /* ExampleWidget */,
97C146EF1CF9000F007C117D /* Products */,
E458450F0521E6D94C4900F1 /* Frameworks */,
BA809C1A17A51DB9BC859D35 /* Pods */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -208,13 +211,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
BA809C1A17A51DB9BC859D35 /* Pods */ = {
isa = PBXGroup;
children = (
);
path = Pods;
sourceTree = "<group>";
};
CAB34E9020F96BDA0024CA6B /* OneSignalNotificationServiceExtension */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -349,7 +345,8 @@
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
E82451E32F0F38D40032825E /* XCRemoteSwiftPackageReference "OneSignal-XCFramework" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -844,17 +841,38 @@
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCRemoteSwiftPackageReference section */
E82451E32F0F38D40032825E /* XCRemoteSwiftPackageReference "OneSignal-XCFramework" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/OneSignal/OneSignal-XCFramework";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.2.15;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
isa = XCSwiftPackageProductDependency;
productName = FlutterGeneratedPluginSwiftPackage;
};
E82451E42F0F38F80032825E /* OneSignalFramework */ = {
isa = XCSwiftPackageProductDependency;
package = E82451E32F0F38D40032825E /* XCRemoteSwiftPackageReference "OneSignal-XCFramework" */;
productName = OneSignalFramework;
};
E82451E62F0F39250032825E /* OneSignalFramework */ = {
isa = XCSwiftPackageProductDependency;
package = E82451E32F0F38D40032825E /* XCRemoteSwiftPackageReference "OneSignal-XCFramework" */;
productName = OneSignalFramework;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
Expand Down
3 changes: 0 additions & 3 deletions example_spm/ios/Runner.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example_spm/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
</dict>
<key>NSSupportsLiveActivities</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is used to send relevant notifications.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
27 changes: 24 additions & 3 deletions example_spm/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class _MyAppState extends State<MyApp> {
String? _language;
String? _liveActivityId;
bool _enableConsentButton = false;
bool _locationShared = false;

// CHANGE THIS parameter to true if you want to test GDPR privacy consent
bool _requireConsent = false;
Expand Down Expand Up @@ -197,8 +198,20 @@ class _MyAppState extends State<MyApp> {
}

void _handleSetLocationShared() {
print("Setting location shared to true");
OneSignal.Location.setShared(true);
_locationShared = !_locationShared;
print("Setting location shared to $_locationShared");
OneSignal.Location.setShared(_locationShared);
setState(() {});
}

void _handleRequestLocationPermission() {
print("Requesting location permission");
OneSignal.Location.requestPermission();
}

void _handleIsLocationShared() async {
var isShared = await OneSignal.Location.isShared();
print('Location shared: $isShared');
}

void _handleGetExternalId() async {
Expand Down Expand Up @@ -394,9 +407,17 @@ class _MyAppState extends State<MyApp> {
_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Set Location Shared",
new OneSignalButton("Location Shared: $_locationShared",
_handleSetLocationShared, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Request Location",
_handleRequestLocationPermission, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton("Is Location Shared",
_handleIsLocationShared, !_enableConsentButton)
]),
new TableRow(children: [
new OneSignalButton(
"Remove Tag", _handleRemoveTag, !_enableConsentButton)
Expand Down
Empty file removed ios/Assets/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions ios/onesignal_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Pod::Spec.new do |s|
s.license = { :file => '../LICENSE' }
s.author = { 'Brad Hesse' => '[email protected]', 'Josh Kasten' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.source_files = 'onesignal_flutter/Sources/onesignal_flutter/**/*.{h,m}'
s.public_header_files = 'onesignal_flutter/Sources/onesignal_flutter/include/**/*.h'
s.dependency 'Flutter'
s.dependency 'OneSignalXCFramework', '5.2.15'
s.ios.deployment_target = '11.0'
Expand Down
32 changes: 32 additions & 0 deletions ios/onesignal_flutter/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "onesignal_flutter",
platforms: [
.iOS("12.0")
],
products: [
.library(name: "onesignal-flutter", targets: ["onesignal_flutter"])
],
dependencies: [
.package(url: "https://github.com/OneSignal/OneSignal-XCFramework", exact: "5.2.15")
],
targets: [
.target(
name: "onesignal_flutter",
dependencies: [
.product(name: "OneSignalFramework", package: "OneSignal-XCFramework"),
.product(name: "OneSignalInAppMessages", package: "OneSignal-XCFramework"),
.product(name: "OneSignalLocation", package: "OneSignal-XCFramework"),
.product(name: "OneSignalExtension", package: "OneSignal-XCFramework")
],
path: "Sources/onesignal_flutter",
cSettings: [
.headerSearchPath("include/onesignal_flutter"),
]
),
]
)
Loading