Skip to content

Commit cf7435d

Browse files
authored
chore: adds example projects for CocoaPods and SPM (#1105)
1 parent ce15a51 commit cf7435d

File tree

173 files changed

+5836
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+5836
-44
lines changed

example/ios/Podfile.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- onesignal_flutter (5.3.4):
4-
- Flutter
5-
- OneSignalXCFramework (= 5.2.15)
63
- OneSignalXCFramework (5.2.15):
74
- OneSignalXCFramework/OneSignalComplete (= 5.2.15)
85
- OneSignalXCFramework/OneSignal (5.2.15):
@@ -52,7 +49,6 @@ PODS:
5249

5350
DEPENDENCIES:
5451
- Flutter (from `Flutter`)
55-
- onesignal_flutter (from `.symlinks/plugins/onesignal_flutter/ios`)
5652
- OneSignalXCFramework (< 6.0.0, >= 5.0.2)
5753

5854
SPEC REPOS:
@@ -62,12 +58,9 @@ SPEC REPOS:
6258
EXTERNAL SOURCES:
6359
Flutter:
6460
:path: Flutter
65-
onesignal_flutter:
66-
:path: ".symlinks/plugins/onesignal_flutter/ios"
6761

6862
SPEC CHECKSUMS:
6963
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
70-
onesignal_flutter: ff13b98ed601f835bb6f59509456773998a3faec
7164
OneSignalXCFramework: ea9e14a95b92ad48d9b35037cbae88a9542bdea3
7265

7366
PODFILE CHECKSUM: 008ee3527530ade7ae7311fc02a615df31949c2e

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
47CD9D2C2BE10D9400F8B006 /* ExampleWidgetLiveActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47CD9D2B2BE10D9400F8B006 /* ExampleWidgetLiveActivity.swift */; };
1818
47CD9D302BE10D9500F8B006 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 47CD9D2F2BE10D9500F8B006 /* Assets.xcassets */; };
1919
47CD9D342BE10D9500F8B006 /* ExampleWidgetExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 47CD9D232BE10D9400F8B006 /* ExampleWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
20+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
2021
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
2122
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
2223
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
@@ -88,6 +89,7 @@
8889
47CD9D312BE10D9500F8B006 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8990
47FF2D2152AD7B79C3388A8D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
9091
6BBCCF44B691DF76AC7D7376 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
92+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
9193
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9294
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
9395
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -131,6 +133,7 @@
131133
isa = PBXFrameworksBuildPhase;
132134
buildActionMask = 2147483647;
133135
files = (
136+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
134137
3370773A86F73EB1712145D3 /* libPods-Runner.a in Frameworks */,
135138
);
136139
runOnlyForDeploymentPostprocessing = 0;
@@ -163,6 +166,7 @@
163166
9740EEB11CF90186004384FC /* Flutter */ = {
164167
isa = PBXGroup;
165168
children = (
169+
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
166170
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
167171
9740EEB21CF90195004384FC /* Debug.xcconfig */,
168172
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -290,7 +294,6 @@
290294
97C146EC1CF9000F007C117D /* Resources */,
291295
CAB34EA020F96F460024CA6B /* Embed App Extensions */,
292296
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
293-
5726744B564FC3637D8684A2 /* [CP] Embed Pods Frameworks */,
294297
9705A1C41CF9048500538489 /* Embed Frameworks */,
295298
);
296299
buildRules = (
@@ -300,6 +303,9 @@
300303
47CD9D332BE10D9500F8B006 /* PBXTargetDependency */,
301304
);
302305
name = Runner;
306+
packageProductDependencies = (
307+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
308+
);
303309
productName = Runner;
304310
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
305311
productType = "com.apple.product-type.application";
@@ -369,6 +375,9 @@
369375
Base,
370376
);
371377
mainGroup = 97C146E51CF9000F007C117D;
378+
packageReferences = (
379+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
380+
);
372381
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
373382
projectDirPath = "";
374383
projectRoot = "";
@@ -450,42 +459,6 @@
450459
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
451460
showEnvVarsInLog = 0;
452461
};
453-
5726744B564FC3637D8684A2 /* [CP] Embed Pods Frameworks */ = {
454-
isa = PBXShellScriptBuildPhase;
455-
buildActionMask = 2147483647;
456-
files = (
457-
);
458-
inputPaths = (
459-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
460-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignal/OneSignalFramework.framework/OneSignalFramework",
461-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore",
462-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalExtension/OneSignalExtension.framework/OneSignalExtension",
463-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalInAppMessages/OneSignalInAppMessages.framework/OneSignalInAppMessages",
464-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalLiveActivities/OneSignalLiveActivities.framework/OneSignalLiveActivities",
465-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalLocation/OneSignalLocation.framework/OneSignalLocation",
466-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalNotifications/OneSignalNotifications.framework/OneSignalNotifications",
467-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalOSCore/OneSignalOSCore.framework/OneSignalOSCore",
468-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalOutcomes/OneSignalOutcomes.framework/OneSignalOutcomes",
469-
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OneSignalXCFramework/OneSignalUser/OneSignalUser.framework/OneSignalUser",
470-
);
471-
name = "[CP] Embed Pods Frameworks";
472-
outputPaths = (
473-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalFramework.framework",
474-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalCore.framework",
475-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalExtension.framework",
476-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalInAppMessages.framework",
477-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalLiveActivities.framework",
478-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalLocation.framework",
479-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalNotifications.framework",
480-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalOSCore.framework",
481-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalOutcomes.framework",
482-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OneSignalUser.framework",
483-
);
484-
runOnlyForDeploymentPostprocessing = 0;
485-
shellPath = /bin/sh;
486-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
487-
showEnvVarsInLog = 0;
488-
};
489462
7C664CCDDCAE18A4FAB2821F /* [CP] Check Pods Manifest.lock */ = {
490463
isa = PBXShellScriptBuildPhase;
491464
buildActionMask = 2147483647;
@@ -966,6 +939,20 @@
966939
defaultConfigurationName = Release;
967940
};
968941
/* End XCConfigurationList section */
942+
943+
/* Begin XCLocalSwiftPackageReference section */
944+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
945+
isa = XCLocalSwiftPackageReference;
946+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
947+
};
948+
/* End XCLocalSwiftPackageReference section */
949+
950+
/* Begin XCSwiftPackageProductDependency section */
951+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
952+
isa = XCSwiftPackageProductDependency;
953+
productName = FlutterGeneratedPluginSwiftPackage;
954+
};
955+
/* End XCSwiftPackageProductDependency section */
969956
};
970957
rootObject = 97C146E61CF9000F007C117D /* Project object */;
971958
}

example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Runner.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"

example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example_pod/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
.dart_tool/
3+
4+
.packages
5+
.pub/
6+
7+
build/
8+
9+
.flutter-plugins
10+
.flutter-plugins-dependencies
11+
flutter_export_environment.sh

example_pod/.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "ac4e799d237041cf905519190471f657b657155a"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: ac4e799d237041cf905519190471f657b657155a
17+
base_revision: ac4e799d237041cf905519190471f657b657155a
18+
- platform: android
19+
create_revision: ac4e799d237041cf905519190471f657b657155a
20+
base_revision: ac4e799d237041cf905519190471f657b657155a
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example_pod/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# onesignal_example
2+
3+
Demonstrates how to use the onesignal plugin.
4+
5+
# iOS
6+
7+
First you may need to run `pod install` in the ios folder.
8+
Then launch a simulator then you can run `flutter run`.
9+
10+
# Android
11+
12+
Make sure you have the Android SDK cli tools and have accepted the license agreements.
13+
E.g.
14+
15+
```
16+
flutter doctor --android-licenses
17+
```
18+
19+
Then launch an Android emulator e.g.
20+
21+
```
22+
flutter emulators --launch Medium_Phone_API_35;
23+
```
24+
25+
And then you can run `flutter run`.
26+
27+
If you are using an older Flutter or Android Studio version, you may see an error about `ndkVersion`. Follow the instructions to update the version in `build.gradle.kts`.
28+
29+
## Getting Started
30+
31+
For help getting started with Flutter, view our online
32+
[documentation](https://flutter.io/).

example_pod/analysis_options.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# Disable style lints for example app
25+
avoid_print: false
26+
unnecessary_new: false
27+
unnecessary_this: false
28+
prefer_const_constructors: false
29+
prefer_const_constructors_in_immutables: false
30+
use_key_in_widget_constructors: false
31+
library_private_types_in_public_api: false
32+
prefer_final_fields: false
33+
prefer_interpolation_to_compose_strings: false
34+
prefer_collection_literals: false
35+
sort_child_properties_last: false
36+
prefer_generic_function_type_aliases: false
37+
annotate_overrides: false
38+
depend_on_referenced_packages: false
39+
40+
# Additional information about this file can be found at
41+
# https://dart.dev/guides/language/analysis-options

example_pod/android/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
.cxx/
9+
10+
# Remember to never publicly share your keystore.
11+
# See https://flutter.dev/to/reference-keystore
12+
key.properties
13+
**/*.keystore
14+
**/*.jks

0 commit comments

Comments
 (0)