サポート #862
iOS版(コミットe6fe129)をParseテストサーバに接続させるソース変更点
ステータス: | 終了 | 開始日: | 2016/08/29 | |
---|---|---|---|---|
優先度: | 通常 | 期日: | ||
担当者: | 矢野 宗一郎 | 進捗 %: | 100% | |
カテゴリ: | - | 作業時間の記録: | 6.00時間 | |
対象バージョン: | - |
説明
■git checkout
origin/develop develop Parse移管テスト作業。
コミットe6fe129
■絶対パスを相対パスに変更
cosplay→TARGETS→cosplay→BuildSettings→Linking→OtherLinkerFlags
"/Users/ihearts_en/Documents/xcode_prj/cosplay/cosplay/thirdparty/8chk/headers/8chk/lib8chk.a"
↓
"./cosplay/thirdparty/8chk/headers/8chk/lib8chk.a"
- Uncomment this line to define a global platform for your project
- platform :ios, '6.0'
use_frameworks!
pod 'SlideMenuControllerSwift', '1.2.1'
pod 'JSQMessagesViewController', '7.1.0'
pod 'JSQMessagesViewController'
pod 'CarbonKit', '1.1.2'
pod "AFNetworking", "2.5.4"
pod 'RNGridMenu', '0.1.2'
pod 'AMPopTip', '0.9.12'
pod 'RSKImageCropper', '1.3.1'
pod 'JDStatusBarNotification', '1.5.2'
pod 'ios-image-editor', '1.1.4'
pod 'RKNotificationHub', '2.0.1'
pod 'FontAwesomeKit', '2.2.0'
pod 'FontAwesomeKit/IonIcons', '2.2.0'
- pod 'FBSDKCoreKit', '4.1.0'★
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit', '4.1.0' - pod 'FBSDKShareKit', '4.1.0'★
pod 'FBSDKShareKit'
end
■IHTimelineTabViewCOntroller.swift
265行目
if let _self = self {
// self!.notificationBadge!.count = UInt(count)
self!.notificationBadge!.count = Int32(count)
★UInt()に出ていたエラー「Cannot assign value of type 'UInt' to type 'Int32'」を出さないようにしただけ
■IHParseDriver.swift
接続サーバの切替え
//
// IHParseDriver.swift
// cosplay
//
// Created by エンジニア on 2015/08/10.
// Copyright (c) 2015年 i-hearts. All rights reserved.
//
155行目
let configuration = ParseClientConfiguration {
// 開発用
// $0.applicationId = "JlICNFLCRZIFyBtxHIucCNBPRL6kALnFlsM42BgI"
// $0.clientKey = "gMA10kCAWZ3vGZQppRSisRGw2uMXXRSYonjHcep1"
// 本番環境
// $0.applicationId = "8cvtzmrNAKkhn5AveiJmh4MfuaK8H6hRBETOwEa9"
// $0.clientKey = "TxW0SVOjNmMJEsUWs1sfUJ3Nx4WHxDCU6Hd0ZQD2"
// Parse移管環境
$0.applicationId = "123"
$0.clientKey = "123"
$0.server = "http://49.212.206.73:1337/parse"
}
Parse.initializeWithConfiguration(configuration)
//開発用
PFTwitterUtils.initializeWithConsumerKey("kS83MvJltZwmfoWVoyE1R6xko", consumerSecret: "YXSupp9hC2m1rugTfoSyqricST9214TwYapQErBcXlP1BrSfND")
// 本番環境
// PFTwitterUtils.initializeWithConsumerKey("zN4fbJUmOUzp6VsN0OBbJktTG", consumerSecret: "wvr11k5Dl02wp3EEkAVG2UfxPBOeQ9fSOXd2U4BhUxGhqVcXlp")
PFFacebookUtils.initializeFacebook()
}
return _instance!
}
履歴
#1 秋山 創介 が8年以上前に更新
■■■■■■■■■■■■■
■IHTalkViewController.swift
234行目
// cell.timeLabel?.text = JSQMessagesTimestampFormatter.sharedFormatter().timeForDate(msg.date)
// cell.timeLabel?.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.5)
■■■■■■■■■■■■■
■SlideMenuController.swift
60行目
// public required init(coder aDecoder: NSCoder) {
public required init(coder aDecoder: NSCoder?) {
// super.init(coder: aDecoder)
super.init(coder: aDecoder!)!
908行目
// for recognizer in recognizers as! [UIGestureRecognizer] {
for recognizer in (recognizers as! [UIGestureRecognizer]?)! {
■AppleDeligate.swift
59行目
// navigationController?.topViewController!.addRightBarButtonWithImage(UIImage(named: "ic_post")!, target: self, action: "onEdit")
#2 秋山 創介 が8年以上前に更新
▪️Podfile
- Uncomment this line to define a global platform for your project
- platform :ios, '6.0'
use_frameworks!
pod 'SlideMenuControllerSwift', '1.2.1'
pod 'JSQMessagesViewController', '7.1.0'
pod 'CarbonKit', '1.1.2'
pod 'AFNetworking', '2.5.4'
pod 'RNGridMenu', '0.1.2'
pod 'AMPopTip', '0.9.12'
pod 'RSKImageCropper', '1.3.1'
pod 'JDStatusBarNotification', '1.5.2'
pod 'ios-image-editor', '1.1.4'
pod 'RKNotificationHub', '2.0.1'
pod 'FontAwesomeKit', '2.2.0'
pod 'FontAwesomeKit/IonIcons', '2.2.0'
- pod 'FBSDKCoreKit', '4.1.0'
pod 'FBSDKCoreKit' - pod 'FBSDKLoginKit', '4.1.0'
pod 'FBSDKLoginKit' - pod 'FBSDKShareKit', '4.1.0'
pod 'FBSDKShareKit'
end
▪️AppDeligate.swift(59行目)
// navigationController?.topViewController!.addRightBarButtonWithImage(UIImage(named: "ic_post")!, target: self, action: "onEdit")
navigationController?.topViewController!.addRightBarButtonWithImage(UIImage(named: "ic_post")!)
▪️IHTalkViewController.swift(234行目)
// cell.timeLabel?.text = JSQMessagesTimestampFormatter.sharedFormatter().timeForDate(msg.date)
// cell.timeLabel?.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.5)
▪️IHTimelineTabViewController.swift(265行目)
if let _self = self {
self!.notificationBadge!.count = UInt(count)
▪️SlideMenuController.swift(907行目)
// for recognizer in recognizers as! [UIGestureRecognizer] {
for recognizer in (recognizers as! [UIGestureRecognizer]?)! {
#3 秋山 創介 が8年以上前に更新
- 担当者 を 秋山 創介 から 矢野 宗一郎 に変更
- 進捗 % を 0 から 100 に変更
IHParseDriver.swift
1891行目 sendPushNotificationを以下に差し替え。
private func sendPushNotification(param: [String: String], receiverID: String, text: String) {
let query = PFInstallation.query()
query?.whereKey(PF_INSTALLATION_USER, equalTo: PFUser(withoutDataWithObjectId: receiverID))
let push = PFPush()
push.setQuery(query)
var data = [String : AnyObject]()
var dic = [String : AnyObject]()
var dic2 = [String : String]()
dic2["alert"] = text
dic["aps"] = dic2
for (key,val) in param {
dic[key] = val
}
data["target"] = receiverID
data["message"] = text
var json: String = ""
do {
// Dict -> JSON
let jsonData = try NSJSONSerialization.dataWithJSONObject(dic, options: []) //(*)options??
json = NSString(data: jsonData, encoding: NSUTF8StringEncoding)! as String
} catch {
print("Error!: \(error)")
}
data["data"] = json
push.setData(dic)
// push.sendPushInBackgroundWithBlock() {
// succeeded, error in
// // nothing to do
// if error != nil {
// print("SendPush Error!!")
// print(error)
// } else {
// print("Send Push Completed!!")
// }
//
// }
PFCloud.callFunctionInBackground("sendClientPush",withParameters:data as [NSObject : AnyObject]){
result, error in
if error != nil {
} else {
}
}
}