Upload
masashi-nishiwaki
View
441
Download
3
Embed Size (px)
Citation preview
Salesforce MobileSDK にモノ申す!
Masashi Nishiwaki
※ 注意• Hybridの場合共通する部分も有りますが、全般的に述べられているのはiOS版に関してです
• あとHybrid版中心でお話します
• ただの愚痴です
• 共感 or 笑ってスルーしてください
• スライド34枚あります
• 言いたいことだけ言って流しまくります
• 私は”西脇”です
• ここ重要!
アンケートタイム
Mobileアプリ開発 やっている人
!
(・ω・)ノシ
Mobile SDK 2.x 使っている人
!
(・ω・)ノシ
for Android 使っている人
!
(・ω・)ノシ
for iOS 使っている人
!
(・ω・)ノシ
Native Appで 使っている人
!
(・ω・)ノシ
Hybrid Appで 使っている人
!
(・ω・)ノシ
zkSforce 使っている人
!
(・ω・)ノシ
それ以外 or 自前でやっている人
!
(・ω・)ノシ
What's New in 2.1
出展: https://github.com/forcedotcom/SalesforceMobileSDK-iOS
Push Notifications
• Registration and delivery of push notifications are now supported from a Salesforce org that enables push notifications.
アプリケーション接続
アプリ側
Apexコード
アプリケーション接続API名
Alert Message, Sound, Badge, User Data
でも今はPilotなので…
• 今後本当にリリースされるかはSFDCさん次第?
• アプリケーション接続が作られた組織内のユーザに対してしかPushできない
• 管理パッケージに含める事が出来るようになれば…
Networking Enhancements
• The underlying networking library has been replaced with MKNetworkKit. MKNetworkKit provides the ability to configure advanced features, such as managing the network queue and cancelation of requests.
• MKNetworkKitに換えて何か良くなったらしいです
Files API Support• The Salesforce Mobile SDK now provides convenience methods that build specialized REST requests for file upload/download and sharing operations.
• A native sample app, FileExplorer, and a hybrid sample app, HybridFileExplorer, have been added to demonstrate these features.
• やっと(ry
SmartSync Enhancements• You can now access custom endpoints using the Force.RemoteObject and Force.RemoteObjectCollection classes.
• You can now access Apex REST endpoints using the Force.ApexRestObject and Force.ApexRestObjectCollection classes.
• NOTE:
• This feature is only available on hybrid apps.
• hybridだけのはなし
• 裏はSmartStore
Other Technical Improvements
• OAuth error handling is now configurable.
• Upgraded the openssl library to v1.0.1e to fix possible security concerns with older versions of openssl.
• You can now add one or more delegates to SFAuthenticationManager. This gives you more granular access to the authentication process.
• Various bug fixes.
• openssl 1.0.1e えっ?
• Heartbeatは使っていないと思いますが
• 話題の話ですので更新してほしいですよね。。
forcetk.mobilesdk.js• $jというGlobal変数が消えました (スコープ化)
• https://github.com/forcedotcom/SalesforceMobileSDK-Shared/commit/213b2ac5bc5a675c25d7b388d3eb8d0b3d841c82
• VFで使えなくなりました。。
• https://github.com/forcedotcom/SalesforceMobileSDK-Shared/commit/698eba5e2aacb2050df636ec21c11ca20ce8cb88
• マルチバイト対応しました (多分)
• escape => encodeURI
• https://github.com/forcedotcom/SalesforceMobileSDK-Shared/commit/cc90d6afb31d9c993dada9de0922b7cc5b3f5d9e
旧バージョンから 引き継いでいる特徴
Native App Point
• Nativeの方使っていない(ry
Hybrid App Point• Cordova 2.3
• 古っ!
• jQuery.ajaxの書き方が古い
• Deferred使おうよ、、
• ajaxが同期/非同期かはインスタンス変数asyncAjaxによって定義
• えっ!?
• forcetk.Client.prototype.query等のレスポンスが生のオブジェクト
• DateとかDatetimeのパースめどい、、、
Common Point
• 複数の組織にはログインできない
• arm64非対応
私からの提案
• ForceTk sObjectを使ってみませんか?
• https://github.com/htz/Force.com-JavaScript-SObject-Toolkit
特徴• Axpe上でsObjectを扱う位簡単にCRUD操作が可能
• 生のSOQL/SOSLクエリを記述する必要がない
• クエリの結果がforcetk.SObject.XXXオブジェクトの配列として返される
• DateやDatetime, Boolean等はそのままJavaScriptのDateやBooleanで扱える
• 初期化時にsObjectのメタデータ取得してModelに相当するものを作成
• 名前空間プレフィックスをシンプルに扱うことが可能
• VF, PhonegapおよびChrome Extentionで利用可能 (example内)
• Phonegap版はもちろんMobileSDK不要 (最新の3.1で動作確認済み)
forcetk.mobilesdk.jsのカスタマイズ
• jQuery.Deferredを利用した形に全て変更
• コードのネストが減って綺麗に書けます
• jQuery#ajaxと同様にasyncプロパティで呼び出し毎に設定できるように変更
• VF及びChrome Extension対応
• 全体的に自分好みに整形