-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 in MML/infobip-mobile-messaging-ios from okoro…
…leva-MM-1878-InteractiveNotificationsBuilder to master Squashed commit of the following: commit cf67afa8f0e390e998b973f01a7e9fd38777157d Author: okoroleva <[email protected]> Date: Tue Jul 25 12:37:40 2017 +0300 isEqual added commit 14fa33b0ce1f14401d54260464653ec44d2c4281 Author: okoroleva <[email protected]> Date: Tue Jul 25 11:26:48 2017 +0300 improvements after review commit 51d8e0ac57d8acecf7a74a9152248d0bb0a2a4b0 Author: okoroleva <[email protected]> Date: Mon Jul 24 17:53:17 2017 +0300 provisionings commit 030db65e5341bd3a1b3197c5744f515d3e711879 Author: okoroleva <[email protected]> Date: Mon Jul 24 17:51:35 2017 +0300 provisionings commit 3f82bace6dfd79a8d470f23e217f6307203e0723 Author: okoroleva <[email protected]> Date: Mon Jul 24 17:45:41 2017 +0300 clean up commit a4af6785f882dce8748a5238dd8253b8e3e94883 Author: okoroleva <[email protected]> Date: Mon Jul 24 17:13:29 2017 +0300 test added commit 334be5f79880a7e3ce9c1bd13e3c70319e7eff04 Author: okoroleva <[email protected]> Date: Mon Jul 24 16:27:59 2017 +0300 in progress commit 21c4bb76d30eb3455b5798a019310cf83b19d22e Author: okoroleva <[email protected]> Date: Mon Jul 24 14:31:07 2017 +0300 in progress commit 801ba7d434d70edd1da805c055ed5a2ef55dac99 Author: okoroleva <[email protected]> Date: Mon Jul 24 11:56:33 2017 +0300 in progress commit d078f3d5d8e2232b5066393f3936fec397cadf98 Author: okoroleva <[email protected]> Date: Mon Jul 24 11:51:52 2017 +0300 inProgress commit 012fd9db6cdcf6c7d0f390ac665508d7d3bb116b Author: okoroleva <[email protected]> Date: Mon Jul 24 11:43:28 2017 +0300 in progress commit 3aa3ad0d8fee453f03e5be11ab9bd74406a524d8 Author: okoroleva <[email protected]> Date: Mon Jul 24 11:26:34 2017 +0300 handlers, Model Objects and library API
- Loading branch information
Showing
13 changed files
with
297 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Example/Tests/MobileMessagingTests/InteractiveNotificationsTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// InteractiveNotificationsTests.swift | ||
// MobileMessagingExample | ||
// | ||
// Created by okoroleva on 24.07.17. | ||
// Copyright © 2017 CocoaPods. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
import MobileMessaging | ||
|
||
class InteractiveNotificationsTests: MMTestCase { | ||
let actionId = "actionId" | ||
let categoryId = "categoryId" | ||
|
||
func testActionHandlerCalled() { | ||
weak var actionHandlerCalled = expectation(description: "action handler called") | ||
weak var testCompleted = expectation(description: "testCompleted") | ||
let action = MMCategoryAction(identifier: actionId, title: "Action", options: nil) { (message, completion) in | ||
actionHandlerCalled?.fulfill() | ||
completion() | ||
} | ||
|
||
let category = MMInteractiveCategory(identifier: categoryId, actions: [action!]) | ||
var set = Set<MMInteractiveCategory>() | ||
set.insert(category!) | ||
|
||
cleanUpAndStop() | ||
var mm = mockedMMInstanceWithApplicationCode(MMTestConstants.kTestCorrectApplicationCode) | ||
mm = mm?.withInteractiveCategories(set) | ||
mm?.start() | ||
|
||
MobileMessaging.handleActionWithIdentifier(identifier: actionId, forRemoteNotification: ["messageId": "1", "aps": ["alert": ["body": "text"], "category": categoryId]], responseInfo: nil) { | ||
testCompleted?.fulfill() | ||
} | ||
|
||
waitForExpectations(timeout: 10, handler: nil) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.