質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -216,90 +216,6 @@
|
|
216
216
|
|
217
217
|
|
218
218
|
|
219
|
-
override func didReceiveMemoryWarning() {
|
220
|
-
|
221
|
-
super.didReceiveMemoryWarning()
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
}
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
override func viewDidAppear(_ animated: Bool) {
|
230
|
-
|
231
|
-
super.viewDidAppear(animated)
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
NotificationCenter.default.addObserver(self, selector: #selector(MainViewController.push(_:)), name: NSNotification.Name(rawValue: "message"), object: nil)
|
236
|
-
|
237
|
-
}
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
override func viewDidDisappear(_ animated: Bool) {
|
242
|
-
|
243
|
-
super.viewDidDisappear(animated)
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
NotificationCenter.default.removeObserver(self)
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
func push(_ notification: Notification) {
|
254
|
-
|
255
|
-
if let message = notification.userInfo?["aps"] as? String {
|
256
|
-
|
257
|
-
let splittedMessage = message.components(separatedBy: "(")
|
258
|
-
|
259
|
-
let last = splittedMessage[splittedMessage.count - 1]
|
260
|
-
|
261
|
-
let filename = last.substring(to: last.characters.index(last.endIndex, offsetBy: -1))
|
262
|
-
|
263
|
-
print("filename: \(filename)")
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
// ダウンロードする
|
268
|
-
|
269
|
-
let downloadRequest = AWSS3TransferManagerDownloadRequest()
|
270
|
-
|
271
|
-
downloadRequest?.bucket = self.BUCKET_NAME
|
272
|
-
|
273
|
-
downloadRequest?.key = filename
|
274
|
-
|
275
|
-
downloadRequest?.downloadingFileURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("tmp.jpg")
|
276
|
-
|
277
|
-
let transferManager = AWSS3TransferManager.default()
|
278
|
-
|
279
|
-
transferManager.download(downloadRequest!).continueWith(block: { (task: AWSTask) -> AnyObject! in
|
280
|
-
|
281
|
-
if nil == task.error {
|
282
|
-
|
283
|
-
print("ダウンロード成功。")
|
284
|
-
|
285
|
-
self.performSegue(withIdentifier: "showImageViewController", sender: self)
|
286
|
-
|
287
|
-
} else {
|
288
|
-
|
289
|
-
print("ダウンロード失敗。error")
|
290
|
-
|
291
|
-
}
|
292
|
-
|
293
|
-
return nil
|
294
|
-
|
295
|
-
})
|
296
|
-
|
297
|
-
}
|
298
|
-
|
299
|
-
}
|
300
|
-
|
301
|
-
|
302
|
-
|
303
219
|
......
|
304
220
|
|
305
221
|
}
|
@@ -333,3 +249,39 @@
|
|
333
249
|
```
|
334
250
|
|
335
251
|
とエラーが出るのですが、なぜでしょうか。アドバイス頂けるとありがたいです。
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
以下のように podでインストールはしました。また、ヘッダーファイルで、objective-cも読み込みました。
|
256
|
+
|
257
|
+
```
|
258
|
+
|
259
|
+
source 'https://github.com/CocoaPods/Specs.git'
|
260
|
+
|
261
|
+
pod 'AWSCore'
|
262
|
+
|
263
|
+
pod 'AWSCloudWatch'
|
264
|
+
|
265
|
+
pod 'AWSDynamoDB'
|
266
|
+
|
267
|
+
pod 'AWSKinesis'
|
268
|
+
|
269
|
+
pod 'AWSLambda'
|
270
|
+
|
271
|
+
pod 'AWSCognitoIdentityProvider'
|
272
|
+
|
273
|
+
pod 'AWSMobileAnalytics'
|
274
|
+
|
275
|
+
pod 'AWSS3'
|
276
|
+
|
277
|
+
pod 'AWSSQS'
|
278
|
+
|
279
|
+
pod 'AWSSNS'
|
280
|
+
|
281
|
+
pod 'AWSCognito'
|
282
|
+
|
283
|
+
pod 'FBSDKCoreKit'
|
284
|
+
|
285
|
+
pod 'FBSDKLoginKit'
|
286
|
+
|
287
|
+
```
|