Skip to content

Commit 3bf0230

Browse files
authored
Merge pull request #5 from IBM-Cloud/updates/1426
Updates/1426
2 parents 74840cd + 91f09c8 commit 3bf0230

File tree

213 files changed

+32645
-133
lines changed

Some content is hidden

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

213 files changed

+32645
-133
lines changed

actions/feedback/AddFeedback.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import Foundation
88
import SwiftyJSON
99

1010
func main(args: [String:Any]) -> [String:Any] {
11-
11+
print("Received:",args)
12+
1213
var str = ""
1314
var subject = ""
1415
var cloudantBody = [String:String]()

actions/feedback/AnalyzeFeedback.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import Dispatch
77
import KituraNet
88

99
func main(args: [String:Any]) -> [String:Any] {
10-
10+
print("Received:",args)
11+
1112
let str = ""
1213
var responseValue = ""
1314
var messageTemplate = ""

actions/users/AddUser.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import Foundation
88
import SwiftyJSON
99

1010
func main(args: [String:Any]) -> [String:Any] {
11+
print("Received:",args)
1112

1213
var str = ""
1314
var subject = ""
1415
var name = "Guest"
15-
var deviceId = ""
16+
var deviceId = args["deviceId"] as? String
1617
var picture = ""
1718
var email = ""
1819
var cloudantBody = [String:String]()
@@ -44,7 +45,6 @@ func main(args: [String:Any]) -> [String:Any] {
4445
if let idTokenFromString = idToken.data(using: .utf8, allowLossyConversion: false) {
4546
let idTokenJSON = JSON(data: idTokenFromString)
4647
name = idTokenJSON["name"].stringValue.isEmpty ? "Guest" : idTokenJSON["name"].stringValue
47-
deviceId = idTokenJSON["oauth_client"]["device_id"].stringValue
4848
cloudantBody["name"] = name
4949
cloudantBody["deviceid"] = deviceId
5050
if(idTokenJSON["amr"][0].stringValue != "appid_anon")

actions/users/PrepareUserNotification.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import Dispatch
77
import Foundation
88

99
func main(args: [String:Any]) -> [String:Any] {
10-
10+
print("Received:",args)
11+
1112
var str = ""
1213
var responseValue = ""
1314
var name = ""
@@ -70,8 +71,8 @@ func main(args: [String:Any]) -> [String:Any] {
7071
}
7172
}
7273
responseData = [
73-
"deviceIds": [deviceIds],
74-
"text": notificationText
74+
"targetDeviceIds": [deviceIds],
75+
"messageText": notificationText
7576
]
7677

7778
return responseData

actions/validate/ValidateToken.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import SwiftyJSON
88

99

1010
func main(args: [String:Any]) -> [String:Any] {
11-
11+
print("Received:",args)
12+
1213
var args: [String:Any] = args
1314
let str = ""
1415
var result: [String:Any] = [

deploy.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,30 @@ function install() {
3333
# # ignore "document already exists error"
3434
curl -s -X POST -H 'Content-Type: application/json' -d @actions/feedback/moods.json $CLOUDANT_URL/moods/_bulk_docs | grep -v conflict
3535

36+
echo "Creating IAM-compatible push notifications package..."
37+
git clone https://github.com/ibm-functions/package-push-notifications.git
38+
(cd package-push-notifications/runtimes/nodejs && ibmcloud fn deploy -m manifest.yaml)
39+
3640
echo "Creating packages..."
3741
ibmcloud fn package create $PACKAGE_NAME\
3842
-p services.cloudant.url $CLOUDANT_URL\
3943
-p services.appid.url $APPID_URL\
4044
-p services.appid.clientId $APPID_CLIENTID\
4145
-p services.appid.secret $APPID_SECRET\
4246
-p services.ta.url $TONE_ANALYZER_URL\
43-
-p services.ta.username $TONE_ANALYZER_USERNAME\
44-
-p services.ta.password $TONE_ANALYZER_PASSWORD\
47+
-p services.ta.username apikey\
48+
-p services.ta.password $TONE_ANALYZER_APIKEY
4549

4650
ibmcloud fn package bind /whisk.system/cloudant \
4751
$PACKAGE_NAME-cloudant \
4852
-p username $CLOUDANT_USERNAME \
4953
-p password $CLOUDANT_PASSWORD \
5054
-p host $CLOUDANT_HOST
5155

52-
ibmcloud fn package bind /whisk.system/pushnotifications \
56+
ibmcloud fn package bind push-notifications \
5357
$PACKAGE_NAME-push \
54-
-p appId $PUSH_APP_GUID \
55-
-p appSecret $PUSH_APP_SECRET \
58+
-p appGuid $PUSH_APP_GUID \
59+
-p apikey $PUSH_APP_APIKEY \
5660
-p apiHost $PUSH_APP_API_HOST
5761

5862
echo "Creating actions..."
@@ -93,7 +97,7 @@ function install() {
9397

9498
# sequence reading the document from cloudant changes then calling analyze feedback on it
9599
ibmcloud fn action create $PACKAGE_NAME/feedback-analyze-sequence \
96-
$PACKAGE_NAME-cloudant/read-document,$PACKAGE_NAME/feedback-analyze,$PACKAGE_NAME/users-prepare-notify,$PACKAGE_NAME-push/sendMessage \
100+
$PACKAGE_NAME-cloudant/read-document,$PACKAGE_NAME/feedback-analyze,$PACKAGE_NAME/users-prepare-notify,$PACKAGE_NAME-push/send-message \
97101
--sequence
98102

99103
echo "Creating triggers..."
@@ -123,6 +127,7 @@ function uninstall() {
123127
ibmcloud fn package delete $PACKAGE_NAME-cloudant
124128
ibmcloud fn package delete $PACKAGE_NAME-push
125129
ibmcloud fn package delete $PACKAGE_NAME
130+
(cd package-push-notifications/runtimes/nodejs && ibmcloud fn deploy -m manifest.yaml)
126131

127132
echo "Done"
128133
ibmcloud fn list
@@ -131,20 +136,19 @@ function uninstall() {
131136
function update() {
132137
echo "Updating actions..."
133138
ibmcloud fn action update $PACKAGE_NAME/auth-validate \
134-
actions/validate/ValidateToken.swift \
139+
actions/validate/ValidateToken.swift
135140

136-
ibmcloud fn action update $PACKAGE_NAME/users-add \
137-
actions/users/AddUser.swift \
141+
ibmcloud fn action update $PACKAGE_NAME/users-add \
142+
actions/users/AddUser.swift
138143

139-
ibmcloud fn action update $PACKAGE_NAME/users-prepare-notify \
140-
actions/users/PrepareUserNotification.swift \
144+
ibmcloud fn action update $PACKAGE_NAME/users-prepare-notify \
145+
actions/users/PrepareUserNotification.swift
141146

142-
ibmcloud fn action update $PACKAGE_NAME/feedback-put \
143-
actions/feedback/AddFeedback.swift \
144-
145-
ibmcloud fn action update $PACKAGE_NAME/feedback-analyze \
146-
actions/feedback/AnalyzeFeedback.swift \
147+
ibmcloud fn action update $PACKAGE_NAME/feedback-put \
148+
actions/feedback/AddFeedback.swift
147149

150+
ibmcloud fn action update $PACKAGE_NAME/feedback-analyze \
151+
actions/feedback/AnalyzeFeedback.swift
148152
}
149153

150154
function showenv() {

followupapp/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
build/
2+
DerivedData
3+
4+
## Various settings
5+
*.pbxuser
6+
!default.pbxuser
7+
*.mode1v3
8+
!default.mode1v3
9+
*.mode2v3
10+
!default.mode2v3
11+
*.perspectivev3
12+
!default.perspectivev3
13+
xcuserdata
14+
15+
## Other
16+
*.xccheckout
17+
*.moved-aside
18+
*.xcuserstate

followupapp/FollowUpappid.xcodeproj/project.pbxproj

100755100644
Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
BD4CE2401E8BDB780018989D /* anonymous.png in Resources */ = {isa = PBXBuildFile; fileRef = BD4CE23F1E8BDB780018989D /* anonymous.png */; };
1515
BD4F2CB71E8908E200BF4057 /* TokenStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD4F2CB61E8908E200BF4057 /* TokenStorage.swift */; };
1616
CFB0DACE856F7BC02E4390CD /* Pods_FollowUpappid.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E4A9588D2E02D651A0A0001 /* Pods_FollowUpappid.framework */; };
17-
EF440D341E34DF0A008B57C4 /* BuildFile in Resources */ = {isa = PBXBuildFile; };
17+
EF440D341E34DF0A008B57C4 /* (null) in Resources */ = {isa = PBXBuildFile; };
1818
EFFC7C5F1E34C71500C3CCB5 /* AfterLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EFFC7C4B1E34C71500C3CCB5 /* AfterLoginViewController.swift */; };
1919
EFFC7C601E34C71500C3CCB5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EFFC7C4C1E34C71500C3CCB5 /* AppDelegate.swift */; };
2020
EFFC7C611E34C71500C3CCB5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EFFC7C4D1E34C71500C3CCB5 /* Assets.xcassets */; };
@@ -152,7 +152,6 @@
152152
EF3DA4601CE0B04D007A2B0A /* Frameworks */,
153153
EF3DA4611CE0B04D007A2B0A /* Resources */,
154154
EE02DEC27C8EC1506F880E86 /* [CP] Embed Pods Frameworks */,
155-
7DCD21DB5B72DE8C551D8D49 /* [CP] Copy Pods Resources */,
156155
);
157156
buildRules = (
158157
);
@@ -191,6 +190,7 @@
191190
developmentRegion = English;
192191
hasScannedForEncodings = 0;
193192
knownRegions = (
193+
English,
194194
en,
195195
Base,
196196
);
@@ -215,7 +215,7 @@
215215
BD4CE2401E8BDB780018989D /* anonymous.png in Resources */,
216216
4690A2801E8CE27F00C8D792 /* anonymous user.png in Resources */,
217217
EFFC7C6A1E34C71500C3CCB5 /* warning.png in Resources */,
218-
EF440D341E34DF0A008B57C4 /* BuildFile in Resources */,
218+
EF440D341E34DF0A008B57C4 /* (null) in Resources */,
219219
EFFC7C631E34C71500C3CCB5 /* Main.storyboard in Resources */,
220220
EFFC7C611E34C71500C3CCB5 /* Assets.xcassets in Resources */,
221221
EFFC7C621E34C71500C3CCB5 /* LaunchScreen.storyboard in Resources */,
@@ -244,45 +244,32 @@
244244
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";
245245
showEnvVarsInLog = 0;
246246
};
247-
7DCD21DB5B72DE8C551D8D49 /* [CP] Copy Pods Resources */ = {
248-
isa = PBXShellScriptBuildPhase;
249-
buildActionMask = 2147483647;
250-
files = (
251-
);
252-
inputPaths = (
253-
);
254-
name = "[CP] Copy Pods Resources";
255-
outputPaths = (
256-
);
257-
runOnlyForDeploymentPostprocessing = 0;
258-
shellPath = /bin/sh;
259-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FollowUpappid/Pods-FollowUpappid-resources.sh\"\n";
260-
showEnvVarsInLog = 0;
261-
};
262247
EE02DEC27C8EC1506F880E86 /* [CP] Embed Pods Frameworks */ = {
263248
isa = PBXShellScriptBuildPhase;
264249
buildActionMask = 2147483647;
265250
files = (
266251
);
267252
inputPaths = (
268-
"${SRCROOT}/Pods/Target Support Files/Pods-FollowUpappid/Pods-FollowUpappid-frameworks.sh",
253+
"${PODS_ROOT}/Target Support Files/Pods-FollowUpappid/Pods-FollowUpappid-frameworks.sh",
269254
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
270255
"${BUILT_PRODUCTS_DIR}/BMSAnalyticsAPI/BMSAnalyticsAPI.framework",
271256
"${BUILT_PRODUCTS_DIR}/BMSCore/BMSCore.framework",
272257
"${BUILT_PRODUCTS_DIR}/BMSPush/BMSPush.framework",
273-
"${BUILT_PRODUCTS_DIR}/BluemixAppID/BluemixAppID.framework",
258+
"${BUILT_PRODUCTS_DIR}/IBMCloudAppID/IBMCloudAppID.framework",
259+
"${BUILT_PRODUCTS_DIR}/JOSESwift/JOSESwift.framework",
274260
);
275261
name = "[CP] Embed Pods Frameworks";
276262
outputPaths = (
277263
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
278264
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BMSAnalyticsAPI.framework",
279265
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BMSCore.framework",
280266
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BMSPush.framework",
281-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BluemixAppID.framework",
267+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IBMCloudAppID.framework",
268+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JOSESwift.framework",
282269
);
283270
runOnlyForDeploymentPostprocessing = 0;
284271
shellPath = /bin/sh;
285-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FollowUpappid/Pods-FollowUpappid-frameworks.sh\"\n";
272+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FollowUpappid/Pods-FollowUpappid-frameworks.sh\"\n";
286273
showEnvVarsInLog = 0;
287274
};
288275
/* End PBXShellScriptBuildPhase section */
@@ -361,7 +348,7 @@
361348
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
362349
GCC_WARN_UNUSED_FUNCTION = YES;
363350
GCC_WARN_UNUSED_VARIABLE = YES;
364-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
351+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
365352
MTL_ENABLE_DEBUG_INFO = YES;
366353
ONLY_ACTIVE_ARCH = YES;
367354
SDKROOT = iphoneos;
@@ -401,7 +388,7 @@
401388
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
402389
GCC_WARN_UNUSED_FUNCTION = YES;
403390
GCC_WARN_UNUSED_VARIABLE = YES;
404-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
391+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
405392
MTL_ENABLE_DEBUG_INFO = NO;
406393
SDKROOT = iphoneos;
407394
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -420,13 +407,13 @@
420407
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
421408
DEVELOPMENT_TEAM = M7XN3GW8UC;
422409
INFOPLIST_FILE = "$(SRCROOT)/FollowUpappid/Info.plist";
423-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
410+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
424411
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
425412
PRODUCT_BUNDLE_IDENTIFIER = FollowUpappidID;
426413
PRODUCT_NAME = "$(TARGET_NAME)";
427414
PROVISIONING_PROFILE = "";
428415
SWIFT_OBJC_BRIDGING_HEADER = "";
429-
SWIFT_VERSION = 3.0;
416+
SWIFT_VERSION = 4.0;
430417
};
431418
name = Debug;
432419
};
@@ -441,13 +428,13 @@
441428
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
442429
DEVELOPMENT_TEAM = M7XN3GW8UC;
443430
INFOPLIST_FILE = "$(SRCROOT)/FollowUpappid/Info.plist";
444-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
431+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
445432
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
446433
PRODUCT_BUNDLE_IDENTIFIER = FollowUpappidID;
447434
PRODUCT_NAME = "$(TARGET_NAME)";
448435
PROVISIONING_PROFILE = "";
449436
SWIFT_OBJC_BRIDGING_HEADER = "";
450-
SWIFT_VERSION = 3.0;
437+
SWIFT_VERSION = 4.0;
451438
};
452439
name = Release;
453440
};

followupapp/FollowUpappid.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)