Skip to content

Commit a41fa9b

Browse files
authored
chore: kickoff release
2 parents 56e5703 + a54eb84 commit a41fa9b

File tree

164 files changed

+6373
-912
lines changed

Some content is hidden

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

164 files changed

+6373
-912
lines changed

.circleci/config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ deploy_requires: &deploy_requires
290290
- ios_unit_test_auth
291291
- ios_unit_test_datastore
292292
- ios_unit_test_geo
293+
- ios_unit_test_push_notifications
293294
- ios_unit_test_storage
294295
- macos_unit_test_amplify
295296
- macos_unit_test_awspluginscore
@@ -298,6 +299,7 @@ deploy_requires: &deploy_requires
298299
- macos_unit_test_auth
299300
- macos_unit_test_datastore
300301
- macos_unit_test_geo
302+
- macos_unit_test_push_notifications
301303
- macos_unit_test_storage
302304
- fortify_scan
303305

@@ -371,6 +373,13 @@ workflows:
371373
destination: << pipeline.parameters.ios-destination >>
372374
requires:
373375
- build_amplify_ios_spm
376+
- unit_test:
377+
name: ios_unit_test_push_notifications
378+
scheme: AWSPinpointPushNotificationsPlugin
379+
sdk: iphonesimulator
380+
destination: << pipeline.parameters.ios-destination >>
381+
requires:
382+
- build_amplify_ios_spm
374383
- unit_test:
375384
name: ios_unit_test_storage
376385
scheme: AWSS3StoragePlugin
@@ -427,6 +436,13 @@ workflows:
427436
destination: << pipeline.parameters.macos-destination >>
428437
requires:
429438
- build_amplify_macos_spm
439+
- unit_test:
440+
name: macos_unit_test_push_notifications
441+
scheme: AWSPinpointPushNotificationsPlugin
442+
sdk: macosx
443+
destination: << pipeline.parameters.macos-destination >>
444+
requires:
445+
- build_amplify_macos_spm
430446
- unit_test:
431447
name: macos_unit_test_storage
432448
scheme: AWSS3StoragePlugin

.github/workflows/integ_test.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
permissions:
88
id-token: write
9-
contents: read
9+
contents: read
1010

1111
concurrency:
1212
group: ${{ github.head_ref || github.run_id }}
@@ -55,6 +55,47 @@ jobs:
5555
project_path: ./AmplifyPlugins/Analytics/Tests/AnalyticsHostApp
5656
scheme: AWSPinpointAnalyticsPluginIntegrationTests
5757

58+
# Disabling these tests because they do not currently work in CI. We will create a ticket to track
59+
# getting resolving this. In the meantime, they can be run locally.
60+
#
61+
# push-notification-integration-test:
62+
# needs: prepare-for-test
63+
# runs-on: macos-12
64+
# environment: IntegrationTest
65+
# steps:
66+
# - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
67+
# with:
68+
# persist-credentials: false
69+
70+
# - name: Make directory
71+
# run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/
72+
73+
# - name: Copy integration test resouces
74+
# uses: ./.github/composite_actions/download_test_configuration
75+
# with:
76+
# resource_subfolder: push-notification
77+
# aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
78+
# aws_region: ${{ secrets.AWS_REGION }}
79+
# aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }}
80+
81+
# - name: Set up node
82+
# uses: actions/setup-node@v3
83+
# with:
84+
# node-version: 16.x
85+
86+
# - name: Run Local Server
87+
# run: |
88+
# cd ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer
89+
# npm install
90+
# npm start &
91+
# shell: bash
92+
93+
# - name: Run Integration test
94+
# uses: ./.github/composite_actions/run_xcodebuild_test
95+
# with:
96+
# project_path: ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp
97+
# scheme: PushNotificationHostApp
98+
5899
auth-integration-test:
59100
needs: prepare-for-test
60101
runs-on: macos-12
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1400"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "AWSPinpointPushNotificationsPlugin"
18+
BuildableName = "AWSPinpointPushNotificationsPlugin"
19+
BlueprintName = "AWSPinpointPushNotificationsPlugin"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "AWSPinpointPushNotificationsPluginUnitTests"
36+
BuildableName = "AWSPinpointPushNotificationsPluginUnitTests"
37+
BlueprintName = "AWSPinpointPushNotificationsPluginUnitTests"
38+
ReferencedContainer = "container:">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
buildConfiguration = "Debug"
45+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
launchStyle = "0"
48+
useCustomWorkingDirectory = "NO"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
debugServiceExtension = "internal"
52+
allowLocationSimulation = "YES">
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<MacroExpansion>
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "AWSPinpointPushNotificationsPlugin"
64+
BuildableName = "AWSPinpointPushNotificationsPlugin"
65+
BlueprintName = "AWSPinpointPushNotificationsPlugin"
66+
ReferencedContainer = "container:">
67+
</BuildableReference>
68+
</MacroExpansion>
69+
</ProfileAction>
70+
<AnalyzeAction
71+
buildConfiguration = "Debug">
72+
</AnalyzeAction>
73+
<ArchiveAction
74+
buildConfiguration = "Release"
75+
revealArchiveInOrganizer = "YES">
76+
</ArchiveAction>
77+
</Scheme>

.swiftpm/xcode/xcshareddata/xcschemes/Amplify-Package.xcscheme

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,20 +272,6 @@
272272
ReferencedContainer = "container:">
273273
</BuildableReference>
274274
</BuildActionEntry>
275-
<BuildActionEntry
276-
buildForTesting = "YES"
277-
buildForRunning = "YES"
278-
buildForProfiling = "NO"
279-
buildForArchiving = "NO"
280-
buildForAnalyzing = "YES">
281-
<BuildableReference
282-
BuildableIdentifier = "primary"
283-
BlueprintIdentifier = "AWSPinpointAnalyticsPluginTests"
284-
BuildableName = "AWSPinpointAnalyticsPluginTests"
285-
BlueprintName = "AWSPinpointAnalyticsPluginTests"
286-
ReferencedContainer = "container:">
287-
</BuildableReference>
288-
</BuildActionEntry>
289275
<BuildActionEntry
290276
buildForTesting = "YES"
291277
buildForRunning = "YES"
@@ -328,6 +314,34 @@
328314
ReferencedContainer = "container:">
329315
</BuildableReference>
330316
</BuildActionEntry>
317+
<BuildActionEntry
318+
buildForTesting = "YES"
319+
buildForRunning = "YES"
320+
buildForProfiling = "YES"
321+
buildForArchiving = "YES"
322+
buildForAnalyzing = "YES">
323+
<BuildableReference
324+
BuildableIdentifier = "primary"
325+
BlueprintIdentifier = "InternalAWSPinpoint"
326+
BuildableName = "InternalAWSPinpoint"
327+
BlueprintName = "InternalAWSPinpoint"
328+
ReferencedContainer = "container:">
329+
</BuildableReference>
330+
</BuildActionEntry>
331+
<BuildActionEntry
332+
buildForTesting = "YES"
333+
buildForRunning = "YES"
334+
buildForProfiling = "YES"
335+
buildForArchiving = "YES"
336+
buildForAnalyzing = "YES">
337+
<BuildableReference
338+
BuildableIdentifier = "primary"
339+
BlueprintIdentifier = "AWSPinpointPushNotificationsPlugin"
340+
BuildableName = "AWSPinpointPushNotificationsPlugin"
341+
BlueprintName = "AWSPinpointPushNotificationsPlugin"
342+
ReferencedContainer = "container:">
343+
</BuildableReference>
344+
</BuildActionEntry>
331345
</BuildActionEntries>
332346
</BuildAction>
333347
<TestAction
@@ -461,6 +475,26 @@
461475
ReferencedContainer = "container:">
462476
</BuildableReference>
463477
</TestableReference>
478+
<TestableReference
479+
skipped = "NO">
480+
<BuildableReference
481+
BuildableIdentifier = "primary"
482+
BlueprintIdentifier = "InternalAWSPinpointUnitTests"
483+
BuildableName = "InternalAWSPinpointUnitTests"
484+
BlueprintName = "InternalAWSPinpointUnitTests"
485+
ReferencedContainer = "container:">
486+
</BuildableReference>
487+
</TestableReference>
488+
<TestableReference
489+
skipped = "NO">
490+
<BuildableReference
491+
BuildableIdentifier = "primary"
492+
BlueprintIdentifier = "AWSPinpointPushNotificationsPluginUnitTests"
493+
BuildableName = "AWSPinpointPushNotificationsPluginUnitTests"
494+
BlueprintName = "AWSPinpointPushNotificationsPluginUnitTests"
495+
ReferencedContainer = "container:">
496+
</BuildableReference>
497+
</TestableReference>
464498
</Testables>
465499
</TestAction>
466500
<LaunchAction
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1400"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Debug"
11+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<Testables>
15+
<TestableReference
16+
skipped = "NO">
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "InternalAWSPinpointUnitTests"
20+
BuildableName = "InternalAWSPinpointUnitTests"
21+
BlueprintName = "InternalAWSPinpointUnitTests"
22+
ReferencedContainer = "container:">
23+
</BuildableReference>
24+
</TestableReference>
25+
</Testables>
26+
</TestAction>
27+
<LaunchAction
28+
buildConfiguration = "Debug"
29+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31+
launchStyle = "0"
32+
useCustomWorkingDirectory = "NO"
33+
ignoresPersistentStateOnLaunch = "NO"
34+
debugDocumentVersioning = "YES"
35+
debugServiceExtension = "internal"
36+
allowLocationSimulation = "YES">
37+
</LaunchAction>
38+
<ProfileAction
39+
buildConfiguration = "Release"
40+
shouldUseLaunchSchemeArgsEnv = "YES"
41+
savedToolIdentifier = ""
42+
useCustomWorkingDirectory = "NO"
43+
debugDocumentVersioning = "YES">
44+
</ProfileAction>
45+
<AnalyzeAction
46+
buildConfiguration = "Debug">
47+
</AnalyzeAction>
48+
<ArchiveAction
49+
buildConfiguration = "Release"
50+
revealArchiveInOrganizer = "YES">
51+
</ArchiveAction>
52+
</Scheme>

Amplify/Amplify.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class Amplify {
3333
public static internal(set) var DataStore = DataStoreCategory()
3434
public static internal(set) var Geo = GeoCategory()
3535
public static internal(set) var Hub = HubCategory()
36+
public static internal(set) var Notifications = NotificationsCategory()
3637
public static internal(set) var Predictions = PredictionsCategory()
3738
public static internal(set) var Storage = StorageCategory()
3839

@@ -70,6 +71,8 @@ public class Amplify {
7071
try Logging.add(plugin: plugin)
7172
case let plugin as PredictionsCategoryPlugin:
7273
try Predictions.add(plugin: plugin)
74+
case let plugin as PushNotificationsCategoryPlugin:
75+
try Notifications.Push.add(plugin: plugin)
7376
case let plugin as StorageCategoryPlugin:
7477
try Storage.add(plugin: plugin)
7578
default:

Amplify/Categories/Analytics/AnalyticsProfile.swift

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct AnalyticsUserProfile {
3535
public init(name: String? = nil,
3636
email: String? = nil,
3737
plan: String? = nil,
38-
location: Location?,
38+
location: Location? = nil,
3939
properties: AnalyticsProperties? = nil) {
4040
self.name = name
4141
self.email = email
@@ -48,46 +48,11 @@ public struct AnalyticsUserProfile {
4848
extension AnalyticsUserProfile {
4949

5050
/// Location specific data
51-
public struct Location {
52-
53-
/// The user's latitude
54-
public var latitude: Double?
55-
56-
/// The user's longitude
57-
public var longitude: Double?
58-
59-
/// The user's postal code
60-
public var postalCode: String?
61-
62-
/// The user's city
63-
public var city: String?
64-
65-
/// The user's region
66-
public var region: String?
67-
68-
/// The user's country
69-
public var country: String?
51+
public typealias Location = UserProfileLocation
52+
}
7053

71-
/// Initializer
72-
/// - Parameters:
73-
/// - latitude: The user's latitude
74-
/// - longitude: The user's longitude
75-
/// - postalCode: The user's postal code
76-
/// - city: The user's city
77-
/// - region: The user's region
78-
/// - country: The user's country
79-
public init(latitude: Double? = nil,
80-
longitude: Double? = nil,
81-
postalCode: String? = nil,
82-
city: String? = nil,
83-
region: String? = nil,
84-
country: String? = nil) {
85-
self.latitude = latitude
86-
self.longitude = longitude
87-
self.postalCode = postalCode
88-
self.city = city
89-
self.region = region
90-
self.country = country
91-
}
54+
extension AnalyticsUserProfile: UserProfile {
55+
public var customProperties: [String: UserProfilePropertyValue]? {
56+
properties as? [String: UserProfilePropertyValue]
9257
}
9358
}

0 commit comments

Comments
 (0)