Skip to content

Commit

Permalink
Added support for simulating device token
Browse files Browse the repository at this point in the history
  • Loading branch information
Paweł Kania committed Sep 24, 2019
1 parent 8c14e7d commit 5353fd9
Show file tree
Hide file tree
Showing 18 changed files with 355 additions and 81 deletions.
Binary file removed Breakpoint.png
Binary file not shown.
Binary file removed Code.png
Binary file not shown.
Binary file added DeviceToken.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// swift-tools-version:5.1
//
// Package.swift
// Package.swift
//
// Copyright (c) 2019 Paweł Kania
//
Expand Down
Binary file added Payload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 25 additions & 1 deletion PushNotificationSimulation.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# swift-tools-version:5.1
#
# PushNotificationSimulation.podspec
#
# Copyright (c) 2019 Paweł Kania
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

Pod::Spec.new do |spec|
spec.name = "PushNotificationSimulation"
spec.version = "1.0.2"
spec.version = "1.1.0"
spec.summary = "Helper in simulating push notifications"
spec.homepage = "https://github.com/pwlkania/PushNotificationSimulation"
spec.license = "MIT"
Expand Down
49 changes: 49 additions & 0 deletions PushNotificationSimulation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
48752453233385D000CC8AB5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48752452233385D000CC8AB5 /* Assets.xcassets */; };
48752456233385D000CC8AB5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 48752454233385D000CC8AB5 /* LaunchScreen.storyboard */; };
4875245C233387F600CC8AB5 /* PushNotificationSimulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4875245B233387F600CC8AB5 /* PushNotificationSimulation.swift */; };
489078B6233A0D7D00E33DC0 /* PushNotificationSimulation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4875241C2333855D00CC8AB5 /* PushNotificationSimulation.framework */; };
489078B7233A0D7D00E33DC0 /* PushNotificationSimulation.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4875241C2333855D00CC8AB5 /* PushNotificationSimulation.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -26,8 +28,29 @@
remoteGlobalIDString = 48752448233385CF00CC8AB5;
remoteInfo = PushNotificationSimulationExamples;
};
489078B8233A0D7D00E33DC0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 487524132333855D00CC8AB5 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4875241B2333855D00CC8AB5;
remoteInfo = PushNotificationSimulation;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
489078BA233A0D7D00E33DC0 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
489078B7233A0D7D00E33DC0 /* PushNotificationSimulation.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
482392CD2334B4F80099A303 /* PushNotificationSimulationExamplesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PushNotificationSimulationExamplesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
482392CF2334B4F80099A303 /* PushNotificationSimulationExamplesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationSimulationExamplesTests.swift; sourceTree = "<group>"; };
Expand All @@ -44,6 +67,7 @@
48752455233385D000CC8AB5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
48752457233385D000CC8AB5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4875245B233387F600CC8AB5 /* PushNotificationSimulation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationSimulation.swift; sourceTree = "<group>"; };
489078BB233A0FA700E33DC0 /* PushNotificationSimulationExamples.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PushNotificationSimulationExamples.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -65,6 +89,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
489078B6233A0D7D00E33DC0 /* PushNotificationSimulation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -96,6 +121,7 @@
4875244A233385D000CC8AB5 /* PushNotificationSimulationExamples */,
482392CE2334B4F80099A303 /* PushNotificationSimulationExamplesTests */,
4875241D2333855D00CC8AB5 /* Products */,
489078B5233A0D7D00E33DC0 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -122,6 +148,7 @@
4875244A233385D000CC8AB5 /* PushNotificationSimulationExamples */ = {
isa = PBXGroup;
children = (
489078BB233A0FA700E33DC0 /* PushNotificationSimulationExamples.entitlements */,
4875244B233385D000CC8AB5 /* AppDelegate.swift */,
4875244D233385D000CC8AB5 /* ViewController.swift */,
4875244F233385D000CC8AB5 /* Main.storyboard */,
Expand All @@ -132,6 +159,13 @@
path = PushNotificationSimulationExamples;
sourceTree = "<group>";
};
489078B5233A0D7D00E33DC0 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -189,10 +223,12 @@
48752445233385CF00CC8AB5 /* Sources */,
48752446233385CF00CC8AB5 /* Frameworks */,
48752447233385CF00CC8AB5 /* Resources */,
489078BA233A0D7D00E33DC0 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
489078B9233A0D7D00E33DC0 /* PBXTargetDependency */,
);
name = PushNotificationSimulationExamples;
productName = PushNotificationSimulationExamples;
Expand Down Expand Up @@ -308,6 +344,11 @@
target = 48752448233385CF00CC8AB5 /* PushNotificationSimulationExamples */;
targetProxy = 482392D22334B4F80099A303 /* PBXContainerItemProxy */;
};
489078B9233A0D7D00E33DC0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4875241B2333855D00CC8AB5 /* PushNotificationSimulation */;
targetProxy = 489078B8233A0D7D00E33DC0 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down Expand Up @@ -509,6 +550,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.PushNotificationSimulation;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -535,6 +577,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.PushNotificationSimulation;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -547,12 +590,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = PushNotificationSimulationExamples/PushNotificationSimulationExamples.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PushNotificationSimulationExamples/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.PushNotificationSimulationExamples;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -564,12 +610,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = PushNotificationSimulationExamples/PushNotificationSimulationExamples.entitlements;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PushNotificationSimulationExamples/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.PushNotificationSimulationExamples;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C5A96C53-7B50-423A-9775-973E89E3002C"
uuid = "AA4454D7-C0FB-45B7-8C69-DC51A13E8338"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "PushNotificationSimulationExamples/ViewController.swift"
timestampString = "590663681.9297071"
filePath = "PushNotificationSimulationExamplesTests/PushNotificationSimulationExamplesTests.swift"
timestampString = "590663681.93013"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "15"
endingLineNumber = "15"
landmarkName = "viewDidLoad()"
startingLineNumber = "59"
endingLineNumber = "59"
landmarkName = "testInstantPush()"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "e simPush(payload: &quot;{\&quot;aps\&quot;:{\&quot;alert\&quot;:{\&quot;title\&quot;:\&quot;Game Request\&quot;,\&quot;subtitle\&quot;:\&quot;Five Card Draw\&quot;,\&quot;body\&quot;:\&quot;Bob wants to play poker\&quot;},\&quot;category\&quot;:\&quot;GAME_INVITATION\&quot;},\&quot;gameID\&quot;:\&quot;12345678\&quot;}&quot;, delay: 3)">
consoleCommand = "e sim(payload: payload1)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
Expand All @@ -32,23 +32,23 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "AA4454D7-C0FB-45B7-8C69-DC51A13E8338"
uuid = "A9A85263-13D9-482B-916D-B404B6FAA508"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "PushNotificationSimulationExamplesTests/PushNotificationSimulationExamplesTests.swift"
timestampString = "590663681.93013"
timestampString = "590663681.9313689"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
landmarkName = "testInstantPush()"
startingLineNumber = "81"
endingLineNumber = "81"
landmarkName = "testDelayedPush()"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "e simPush(payload: payload1)">
consoleCommand = "e sim(payload: payload2)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
Expand All @@ -57,23 +57,94 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A9A85263-13D9-482B-916D-B404B6FAA508"
uuid = "D079F9BC-5FBC-4EC1-A9AB-FDAFB592C299"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "PushNotificationSimulationExamplesTests/PushNotificationSimulationExamplesTests.swift"
timestampString = "590663681.9313689"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "75"
endingLineNumber = "75"
landmarkName = "testDelayedPush()"
startingLineNumber = "125"
endingLineNumber = "125"
landmarkName = "testDelayedDeviceToken()"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "e sim(deviceToken: deviceToken2)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "2366046A-7A34-407E-946A-A1A58E1DBD06"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "PushNotificationSimulationExamplesTests/PushNotificationSimulationExamplesTests.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "103"
endingLineNumber = "103"
landmarkName = "testInstantDeviceToken()"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "e sim(deviceToken: deviceToken1)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "BD564A01-56AE-40C9-9578-F2FEB4C84D8C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "PushNotificationSimulationExamples/ViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
endingLineNumber = "16"
landmarkName = "viewDidLoad()"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "e sim(deviceToken: &quot;933e3112d1eae4a1d8eb48617a265b303be28b300193b9677f0ccf52a63a5b1e&quot;)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "46592A90-CC5F-42EE-B1D3-2F69F2A7BB5C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "PushNotificationSimulationExamples/ViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "15"
endingLineNumber = "15"
landmarkName = "viewDidLoad()"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "e simPush(payload: payload2)">
consoleCommand = "e sim(payload: &quot;{\&quot;aps\&quot;:{\&quot;alert\&quot;:{\&quot;title\&quot;:\&quot;Game Request\&quot;,\&quot;subtitle\&quot;:\&quot;Five Card Draw\&quot;,\&quot;body\&quot;:\&quot;Bob wants to play poker\&quot;},\&quot;category\&quot;:\&quot;GAME_INVITATION\&quot;},\&quot;gameID\&quot;:\&quot;12345678\&quot;}&quot;, delay: 3)">
</ActionContent>
</BreakpointActionProxy>
</Actions>
Expand Down
Loading

0 comments on commit 5353fd9

Please sign in to comment.