Upload
salesforce-developers-japan
View
1.099
Download
3
Embed Size (px)
DESCRIPTION
Citation preview
#forcedotcomjp
Developer Forceをフォローください@developerforcej/ #forcedotcomjp
Developer Force Japan
+Developer Force Japan
Developer Force Japan
Developer Force Group
#forcedotcomjp
Safe HarborSafe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. This documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
#forcedotcomjp
アジェンダ▪ Salesforce1モバイルのプッシュ通知!
▪ Salesforce1モバイルのセキュリティ!
▪ Mobile SDKのプッシュ通知!
▪ Mobile SDKのセキュリティ
#forcedotcomjp
Salesforce1モバイルアプリのプッシュ通知機能
▪ Spring ’14 から、タスク(ToDo)を割り当てる事で”好きなタイミング”でPUSH通知が可能になりました!
#forcedotcomjp
Salesforce1モバイルアプリのプッシュ通知機能 -利用方法-
▪ Apex でTask を作成する、など、、
Task pushtask = new Task(OwnerId = <通知したい相手のUser Id>, WhatId = <関連させるレコードが有ればレコードのID>, Subject = <お好みで>, ReminderDateTime =<こちらもお好みで>, ・ ・ ); Insert pushtask;
#forcedotcomjp
Salesforce1モバイルアプリのセキュリティ機能
▪ モバイルのセキュリティの設定は”接続アプリケーション”に集約
初期状態では表示されません。 Salesforce1 アプリの初回ログイン後 or AppExchangeインストール後に表示されます。
#forcedotcomjp
プロファイルで会社の固定IPなどを利用してIP制限を行っている場合でも、社外のモバイルからアクセスを許可
<セッション管理>Salesforce1 モバイルアプリのリフレッシュトークンの有効期限を設定 • デフォルトではユーザ操作でログアウトしない限りは有効
• アクセス時にログインが必要 • n時間(月・日)アクセスが無かった場合にログインを強制
• 時間(月・日)毎にログインを強制
#forcedotcomjp
Mobile SDK 2.1からの待望の新機能!▪ 対応デバイス!▪ Apple iOS!! Apple Push Notification Service (APNS)!▪ Google Android!! Google Cloud Messaging for Android (GCM)!
#forcedotcomjp
Push Notificationの仕組み (Apple)1. Push通知許可を登録!2. デバイストークン取得!3. デバイストークンを保存!4. Push通知を依頼!
5. デバイスへPush通知 APNsAppサーバ 213
4
5
#forcedotcomjp
Push Notificationの仕組み (Android GCM)1. Push通知許可を登録!
2. Registration ID取得!
3. Registration IDを保存!
4. Push通知を依頼!
5. デバイスへPush通知GCM2
13
4
5Appサーバ
#forcedotcomjp
Push Notificationの仕組み (Mobile SDK)1. Push通知許可を登録!
2. Device Token / Registration ID取得!
3. Device Token / Registration IDを保存!
4. Push通知を依頼!
5. デバイスへPush通知
APNs/ GCM
213
4
5Appサーバ
Mobile SDK
#forcedotcomjp
プロジェクトの作成forceios create \! --apptype=native \! --appname="S1MobileDevWebinar" \! --companyid=com.salesforce.sse.mtsuji \! --organization=tsuji \! --appid=【コンシューマ鍵】 \!
--callbackuri=【コールバックURL】!
--outputdir=. \!
#forcedotcomjp
プロジェクトの作成forcedroid create \! --apptype=native \! --appname="S1MobileDevWebinar" \! --targetdir=. \! --packagename=com.salesforce.sse.mtsuji.s1webinar \! --usesmartstore=false
#forcedotcomjp
res/values/bootconfig.xmlの修正<resources>! <string name="remoteAccessConsumerKey">【コンシューマ鍵】</string>!
<string name="oauthRedirectURI">【コールバックURL】</string>!
<string-array name="oauthScopes">! <item>api</item>! </string-array>! <string name="androidPushNotificationClientId">【Project Number】</string>!
</resources>
#forcedotcomjp
Push通知用クラスの作成package com.salesforce.sse.mtsuji.s1webinar;!
!import org.apache.cordova.api.LOG;!
import android.os.Bundle;!
import com.salesforce.androidsdk.push.PushNotificationInterface;!
!public class MyPush implements PushNotificationInterface {!
! @Override!
! public void onPushMessageReceived(Bundle message) {!
! ! // TODO Auto-generated method stub!
! }!
}!
#forcedotcomjp
XXXApp#onCreateの修正@Override!
public void onCreate() {!
! super.onCreate();!
! SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), MainActivity.class);!
!! /*!
! * Un-comment the line below to enable push notifications in this app.!
! * Replace 'pnInterface' with your implementation of 'PushNotificationInterface'.!
! * Add your Google package ID in 'bootonfig.xml', as the value!
! * for the key 'androidPushNotificationClientId'.!
! */!
! // SalesforceSDKManager.getInstance().setPushNotificationReceiver(pnInterface);!
}
#forcedotcomjp
XXXApp#onCreateの修正@Override!
public void onCreate() {!
! super.onCreate();!
! SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), MainActivity.class);!
! /*!
! * Un-comment the line below to enable push notifications in this app.!
! * Replace 'pnInterface' with your implementation of 'PushNotificationInterface'.!
! * Add your Google package ID in 'bootonfig.xml', as the value!
! * for the key 'androidPushNotificationClientId'.!
! */!
! SalesforceSDKManager.getInstance().setPushNotificationReceiver(new MyPush());!
}
#forcedotcomjp
ApexからPushを送信 (Apple/Android共通)Set<String> users = new Set<String> { // Pushするユーザ! UserInfo.getUserId()!};!Messaging.PushNotification msg =! new Messaging.PushNotification();!msg.setPayload(payload);!msg.send(【アプリケーション接続API名】, users); // 送信
#forcedotcomjp
AppleのPayloadMap<String, Object> payload = Messaging.PushNotificationPayload.apple(! 'メッセージ', // 通知メッセージ! 'default', // サウンド! 99, // バッジ! new Map<String, Object> {! // データ! }!);!
#forcedotcomjp
参考文献▪ Document!
http://sfdc.co/MobileSDKPNS!▪ Qiita: MobileSDKを使わずにSalesforceにアクセスする
iPhoneアプリを作る【プッシュ通知編】!
http://qiita.com/pomu0325/items/7dae8ba399523f3e59f1!
#forcedotcomjp
まとめ▪ Salesforce1 & Mobile SDK双方とも!
▪ Push通知が可能で、セキュリティ設定も柔軟!▪ 共通化されている部分は知識を流用できる!
▪ 接続アプリケーション!▪ PIN保護!