SlideShare a Scribd company logo
1 of 25
Download to read offline
Salesforce Mobile SDK
        ISV Architect, 中嶋 一樹
Safe Harbor
Safe 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 April 30, 2011. 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.
ネイティブアプリ
iOSネイティブアプリの特徴

•リッチなユーザーインターフェース
•デバイス機能の活用
•App Storeでの配信
•XcodeとObjective Cで開発
•ホーム画面に残る
Force.comと連携するiOSネイティブアプリのアーキテクチャ

         データベース
              Apex
     ③リクエスト   API                              ①認証・認可


        リソースサーバ                                認証サーバ

                                                    Force.com

                     ②アクセストークン


                       Salesforce Mobile SDK


                             iOS SDK
Demo App
Mobile SDKのインストールとプロジェクト作成

 Xcodeのインストール



 githubのレポジトリをクローン(ダウンロード)

 $ git clone https://github.com/forcedotcom/SalesforceMobileSDK-iOS.gt



 インストールスクリプトを実行

 $ cd SalesforceMobileSDK-iOS/
 $ ./install.sh



 Native Force.com REST Appテンプレートからプロジェクトを作成

 *Use Automatic Reference Countingのチェックをはずす
Mobile SDK Nativeテンプレートの構造

 AppDelegate

     Consumer IDとCallback URLを設定


 RootViewController

     認証後のアプリケーションのメイン画面を制御
     *サンプルアプリではユーザ名を10個取得し、テーブルビューに表示


 SFAuthorizingViewController

     認証画面を制御


 SFNativeRestAppDelegate
     UIApplicationDelegateプロトコルに従い、アプリケーション起動から認証までの挙動を
     担当
SFNativeRestAppDelegate

   didFinishLauchingWithOptions:(NSDictionary *)launchOptions
        setupAuthorizingViewControllerをキック



   setupAuthorizingViewController

        rootViewControllerにSFAuthorizingViewControllerのインスタンスをセットし、アク
        ティブに


   loggedIn

        newRootViewControllerをキックしrootViewControllerに
        RootViewController(アプリのコントローラ)をセットし、アクティブに
        *newRootViewControllerはAppDelegateで実装されている
RootViewController


 viewDidLoad
        メニューバーのタイトルをセット
        Force.comからユーザー名を10個取得

SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:@"SELECT Name FROM User LIMIT 10"];
[[SFRestAPI sharedInstance] send:request delegate:self];




 didLoadResponse:(id)jsonResponse

        レスポンスをself.datarowsにセット



 cellForRowAtIndexPath:(NSIndexPath *)indexPath

        テーブルのセルをデキューまたは生成し、ユーザー名をセット
UIApplicationDelegate    UIAlertViewDelegate       UIViewController       UITableViewController

                        SFAuthCoodinatorDelegate
                                                         Subclass


                                    SFAuthorizingViewController

                         Protocol


                              SFNativeRestAppDelegate


                                    Subclass                                      Subclass


                                           AppDelegate                RootViewController

                                                                        Import

                                               Import       SFRestAPI            SFRestRequest
CRUD操作

レコード作成

NSString *objectType = @"Contact";
NSDictionary *fields = [@"{FirstName:Kazuki, LastName:Nakajima}" JSONValue];

SFRestRequest *request = [[SFRestAPI sharedInstance]
     requestForCreateWithObjectType:objectType fields:fields];

[[SFRestAPI sharedInstance] send:request delegate:self];




レコード削除
NSString *objectId = @"1234567890";
NSString *objectType = @"Contact";

 SFRestRequest *request = [[SFRestAPI sharedInstance]
     requestForDeleteWithObjectType:objectType objectId:objectId];

[[SFRestAPI sharedInstance] send:request delegate:self];
ハイブリッドアプリ
iOSハイブリッドアプリの特徴

•Web技術での開発
•デバイス機能を呼び出し可能
•App Storeでの配信
•ホーム画面に残る
Force.comと連携するiOSハイブリッドアプリのアーキテクチャ

         データベース
              Apex
     ③リクエスト   API                                    ①認証・認可


         リソースサーバ                                          認証サーバ

                                                             Force.com

                     ②アクセストークン

                      Force.com Javascript REST Toolkit


                        Salesforce Mobile SDK

                                 iOS SDK
Demo App
プロジェクト作成

 Hybrid Force.com Appテンプレートからプロジェクトを作成
 *Use Automatic Reference Countingのチェックをはずす




 wwwフォルダを右クリックして一旦削除する
 ポップアップではRemove Referencesをクリック



 プロジェクトを右クリックしてshow in finderを選択し、wwwフォルダをドラッグ&
 ドロップでプロジェクトに追加する
 *Copy items into destination group’s folder (if needed)を選択
 *Create folder references for any added foldersを選択


 wwwフォルダが青色であることを確認する
Mobile SDK Hybridテンプレートの構造

 bootconfig.js
     Consumer IDとCallback URL等の設定を記述

 forcetk.js
     Force.com JavaScript REST Toolkit。RESTアクセスのラッパー


 index.html
     アプリケーションのメイン画面


 inline.js
     サンプルアプリの処理

 SalesforceOAuthPlugin.js
     PhoneGapのAPIを利用して認証処理を実装

 phonegap-x.x.x.js
     PhoneGapのAPIを提供
bootconfig.js
  debugMode = true | false;
       logToConsoleメソッドの出力がスクリーンに表示されるかどうか

  remoteAccessConsumerKey = xxx;

       コンシューマ          をセット

  oauthRedirectURI = [xxx]

       コールバックURLをセット

  oauthScopes = ['xxx','xxx'];

       発行されるトークンの権限

  startData =   new SFHybridApp.LocalAppStartData(); |
                        new SFHybridApp.RemoteAppStartData("[VFページのパス]");


       コンテンツがローカル管理の場合はLocalAppStartData()をセット
       コンテンツがVisualforce管理の場合はRemoteAppStartData()をセット

  autoRefreshOnForeground = true | false;

       OAuthセッションを自動リフレッシュするかどうか
index.html

   jQuery(document).ready(function(){}
        devicereadyイベント発生時にonDeviceReady()をキックすることを登録



   onDeviceReady(){}

        SalesforceOAuthPlugin.getAuthCredentials()をキック
        salesforceSessionRefreshイベント発生時にsalesforceSessionRefreshed()をキックする
        ことを登録
        reLinkClickHandlers()をキック(サンプルアプリのクリックイベントを登録)

   salesforceSessionRefreshed(){}

        forcetk.Clientのインスタンスを生成し、認証で得られたトークンをセット
PhongeGap.plist
*ファイルの場所はプロジェクト名 > Supporting Files > PhoneGap.plist




ExternalHosts

      JavaScriptやCSSのライブラリを外部サーバから読み込む場合はドメインを明記する必要がある
Force.com JavaScript REST Toolkit

   インスタンス生成
       var forcetkClient = new forcetk.Client(clientId, loginUrl, proxyUrl);

   トークンセット
       forcetkClient.setSessionToken(sessionId, apiVersion, instanceUrl);


   レコード作成
       forcetkClient.create(objtype, fields, callback, error);


   レコード削除
       forcetkClient.del(objtype, id, callback, error);


   SOQL発行

       forcetkClient.query(soql, callback, error);


   Apex Rest発行

       forcetk.Client.apexrest(path, callback, error, method, payload, retry);
PhoneGapで提供される機能

             加速度センサー                             位置情報
             カメラ                                 プッシュ通知
             コンパス                                音楽データ
             連絡先                                 マイク
             ストレージ                               回線


カメラ呼び出しの例

 $j(document).on('tap', '#page_create_survey #button_capture_business_card', function(){
     navigator.camera.getPicture(onCameraSuccess, onCameraFail, { quality: 50,
         destinationType: Camera.DestinationType.DATA_URL
     });
 });



 各APIについて詳しくはhttp://docs.phonegap.com/en/1.6.1/index.htmlを参照
ありがとうございました!

More Related Content

What's hot

Sl study 20150804-soft-layer-apibasic-shibata
Sl study 20150804-soft-layer-apibasic-shibataSl study 20150804-soft-layer-apibasic-shibata
Sl study 20150804-soft-layer-apibasic-shibataNaoki Shibata
 
Salesforce Lightning をやってみてあれこれ
Salesforce Lightning をやってみてあれこれSalesforce Lightning をやってみてあれこれ
Salesforce Lightning をやってみてあれこれ寛 吉田
 
Cordovaの最近ホットな話題と地雷をまとめて紹介
Cordovaの最近ホットな話題と地雷をまとめて紹介Cordovaの最近ホットな話題と地雷をまとめて紹介
Cordovaの最近ホットな話題と地雷をまとめて紹介アシアル株式会社
 
MTでのプレビューサイト制作
MTでのプレビューサイト制作MTでのプレビューサイト制作
MTでのプレビューサイト制作Kei Yoshida
 
絶対使いたくなるAppexchangeアプリとそのアーキテクチャー
絶対使いたくなるAppexchangeアプリとそのアーキテクチャー絶対使いたくなるAppexchangeアプリとそのアーキテクチャー
絶対使いたくなるAppexchangeアプリとそのアーキテクチャーKazuki Nakajima
 
CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~
CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~
CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~decode2016
 
[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介
[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介
[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介david9142
 
HTML5ハイブリッドアプリ開発のベストプラクティス
HTML5ハイブリッドアプリ開発のベストプラクティスHTML5ハイブリッドアプリ開発のベストプラクティス
HTML5ハイブリッドアプリ開発のベストプラクティスアシアル株式会社
 
今さらきけない環境ハブ
今さらきけない環境ハブ今さらきけない環境ハブ
今さらきけない環境ハブKazuki Nakajima
 
jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発
jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発
jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発Daizen Ikehara
 
ASP.NET MVC と jQuery で実践する標準志向 Web 開発
ASP.NET MVC と jQuery で実践する標準志向 Web 開発ASP.NET MVC と jQuery で実践する標準志向 Web 開発
ASP.NET MVC と jQuery で実践する標準志向 Web 開発Akira Inoue
 
2011年マイクロソフト テクノロジー振り返り~開発編~
2011年マイクロソフト テクノロジー振り返り~開発編~2011年マイクロソフト テクノロジー振り返り~開発編~
2011年マイクロソフト テクノロジー振り返り~開発編~Takeshi Shinmura
 
Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018
Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018
Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018Takeshi Fujimoto
 
初めての Data API CMS どうでしょう - 仙台編 -
初めての Data API   CMS どうでしょう - 仙台編 -初めての Data API   CMS どうでしょう - 仙台編 -
初めての Data API CMS どうでしょう - 仙台編 -Yuji Takayama
 

What's hot (20)

Sl study 20150804-soft-layer-apibasic-shibata
Sl study 20150804-soft-layer-apibasic-shibataSl study 20150804-soft-layer-apibasic-shibata
Sl study 20150804-soft-layer-apibasic-shibata
 
Salesforce Lightning をやってみてあれこれ
Salesforce Lightning をやってみてあれこれSalesforce Lightning をやってみてあれこれ
Salesforce Lightning をやってみてあれこれ
 
Visualforce + jQuery
Visualforce + jQueryVisualforce + jQuery
Visualforce + jQuery
 
Cordovaの最近ホットな話題と地雷をまとめて紹介
Cordovaの最近ホットな話題と地雷をまとめて紹介Cordovaの最近ホットな話題と地雷をまとめて紹介
Cordovaの最近ホットな話題と地雷をまとめて紹介
 
iOS開発豆知識_エスキュービズム勉強会20141006
iOS開発豆知識_エスキュービズム勉強会20141006iOS開発豆知識_エスキュービズム勉強会20141006
iOS開発豆知識_エスキュービズム勉強会20141006
 
Force.com開発基礎
Force.com開発基礎Force.com開発基礎
Force.com開発基礎
 
Spring12新機能webinar
Spring12新機能webinarSpring12新機能webinar
Spring12新機能webinar
 
MTでのプレビューサイト制作
MTでのプレビューサイト制作MTでのプレビューサイト制作
MTでのプレビューサイト制作
 
絶対使いたくなるAppexchangeアプリとそのアーキテクチャー
絶対使いたくなるAppexchangeアプリとそのアーキテクチャー絶対使いたくなるAppexchangeアプリとそのアーキテクチャー
絶対使いたくなるAppexchangeアプリとそのアーキテクチャー
 
iOS WebView App
iOS WebView AppiOS WebView App
iOS WebView App
 
CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~
CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~
CLT-009_Windows 10 アプリとシングルサインオン ~Microsoft Passport の意義とその実装方法~
 
[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介
[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介
[公開用]Netラボ2012年2月勉強会 asp.netmvc4 beta新機能の紹介
 
HTML5ハイブリッドアプリ開発のベストプラクティス
HTML5ハイブリッドアプリ開発のベストプラクティスHTML5ハイブリッドアプリ開発のベストプラクティス
HTML5ハイブリッドアプリ開発のベストプラクティス
 
今さらきけない環境ハブ
今さらきけない環境ハブ今さらきけない環境ハブ
今さらきけない環境ハブ
 
jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発
jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発
jQuery/Html5/ASP.NET MVC 対応コンポーネントを用いたデバイス対応業務アプリケーション開発
 
Summer '14開発者向け新機能Webinar
Summer '14開発者向け新機能WebinarSummer '14開発者向け新機能Webinar
Summer '14開発者向け新機能Webinar
 
ASP.NET MVC と jQuery で実践する標準志向 Web 開発
ASP.NET MVC と jQuery で実践する標準志向 Web 開発ASP.NET MVC と jQuery で実践する標準志向 Web 開発
ASP.NET MVC と jQuery で実践する標準志向 Web 開発
 
2011年マイクロソフト テクノロジー振り返り~開発編~
2011年マイクロソフト テクノロジー振り返り~開発編~2011年マイクロソフト テクノロジー振り返り~開発編~
2011年マイクロソフト テクノロジー振り返り~開発編~
 
Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018
Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018
Xamarin in Microsoft Build 2018 - JXUG Fukuoka May-25-2018
 
初めての Data API CMS どうでしょう - 仙台編 -
初めての Data API   CMS どうでしょう - 仙台編 -初めての Data API   CMS どうでしょう - 仙台編 -
初めての Data API CMS どうでしょう - 仙台編 -
 

Similar to Tech talk salesforce mobile sdk

jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発Akira Inoue
 
I Log On Saa S
I Log On Saa SI Log On Saa S
I Log On Saa Stotty jp
 
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメXamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメYoshito Tabuchi
 
プロトコルから見るID連携
プロトコルから見るID連携プロトコルから見るID連携
プロトコルから見るID連携Naohiro Fujie
 
Apexコアデベロッパーセミナー070726 配布用
Apexコアデベロッパーセミナー070726 配布用Apexコアデベロッパーセミナー070726 配布用
Apexコアデベロッパーセミナー070726 配布用stomita
 
AppiumのWebViewアプリテストの仕組みとハマりどころ
AppiumのWebViewアプリテストの仕組みとハマりどころAppiumのWebViewアプリテストの仕組みとハマりどころ
AppiumのWebViewアプリテストの仕組みとハマりどころMasayuki Wakizaka
 
Spring BootでHello Worldのその先へ
Spring BootでHello Worldのその先へSpring BootでHello Worldのその先へ
Spring BootでHello Worldのその先へMasatoshi Fujino
 
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips   Prism 4.5 & Kona project 等のご紹介XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips   Prism 4.5 & Kona project 等のご紹介
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介Shotaro Suzuki
 
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...Shotaro Suzuki
 
Data apiで実現 進化するwebの世界
Data apiで実現 進化するwebの世界Data apiで実現 進化するwebの世界
Data apiで実現 進化するwebの世界Yuji Takayama
 
ボット開発でも DevOps! BotBuilder のテスト手法
ボット開発でも DevOps! BotBuilder のテスト手法ボット開発でも DevOps! BotBuilder のテスト手法
ボット開発でも DevOps! BotBuilder のテスト手法Kenichiro Nakamura
 
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介Fumiya Sakai
 
appengine ja night #24 Google Cloud Endpoints and BigQuery
appengine ja night #24 Google Cloud Endpoints and BigQueryappengine ja night #24 Google Cloud Endpoints and BigQuery
appengine ja night #24 Google Cloud Endpoints and BigQueryRyo Yamasaki
 
Entity Framework 5.0 deep dive
Entity Framework 5.0 deep diveEntity Framework 5.0 deep dive
Entity Framework 5.0 deep diveAtsushi Fukui
 
リアルFacebookガジェットを作った(ロングバージョン)
リアルFacebookガジェットを作った(ロングバージョン)リアルFacebookガジェットを作った(ロングバージョン)
リアルFacebookガジェットを作った(ロングバージョン)Mariko Goda
 
20111031 MobileWeb at TDC
20111031 MobileWeb at TDC20111031 MobileWeb at TDC
20111031 MobileWeb at TDCNobuhiro Sue
 
AppExchangeパートナー&デベロッパー第2部:20070523版
AppExchangeパートナー&デベロッパー第2部:20070523版AppExchangeパートナー&デベロッパー第2部:20070523版
AppExchangeパートナー&デベロッパー第2部:20070523版Junichiro Tasaki
 

Similar to Tech talk salesforce mobile sdk (20)

jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発
 
I Log On Saa S
I Log On Saa SI Log On Saa S
I Log On Saa S
 
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメXamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
 
プロトコルから見るID連携
プロトコルから見るID連携プロトコルから見るID連携
プロトコルから見るID連携
 
Webに今求められているレベル: HTML5 コントロールを利用した開発
Webに今求められているレベル: HTML5 コントロールを利用した開発Webに今求められているレベル: HTML5 コントロールを利用した開発
Webに今求められているレベル: HTML5 コントロールを利用した開発
 
Apexコアデベロッパーセミナー070726 配布用
Apexコアデベロッパーセミナー070726 配布用Apexコアデベロッパーセミナー070726 配布用
Apexコアデベロッパーセミナー070726 配布用
 
AppiumのWebViewアプリテストの仕組みとハマりどころ
AppiumのWebViewアプリテストの仕組みとハマりどころAppiumのWebViewアプリテストの仕組みとハマりどころ
AppiumのWebViewアプリテストの仕組みとハマりどころ
 
Spring BootでHello Worldのその先へ
Spring BootでHello Worldのその先へSpring BootでHello Worldのその先へ
Spring BootでHello Worldのその先へ
 
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips   Prism 4.5 & Kona project 等のご紹介XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips   Prism 4.5 & Kona project 等のご紹介
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介
 
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
 
Data apiで実現 進化するwebの世界
Data apiで実現 進化するwebの世界Data apiで実現 進化するwebの世界
Data apiで実現 進化するwebの世界
 
ボット開発でも DevOps! BotBuilder のテスト手法
ボット開発でも DevOps! BotBuilder のテスト手法ボット開発でも DevOps! BotBuilder のテスト手法
ボット開発でも DevOps! BotBuilder のテスト手法
 
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
RxDataSourceをNSDiffableDataSourceへ置き換える際のTips集紹介
 
APIMeetup 20170329_ichimura
APIMeetup 20170329_ichimuraAPIMeetup 20170329_ichimura
APIMeetup 20170329_ichimura
 
appengine ja night #24 Google Cloud Endpoints and BigQuery
appengine ja night #24 Google Cloud Endpoints and BigQueryappengine ja night #24 Google Cloud Endpoints and BigQuery
appengine ja night #24 Google Cloud Endpoints and BigQuery
 
Entity Framework 5.0 deep dive
Entity Framework 5.0 deep diveEntity Framework 5.0 deep dive
Entity Framework 5.0 deep dive
 
リアルFacebookガジェットを作った(ロングバージョン)
リアルFacebookガジェットを作った(ロングバージョン)リアルFacebookガジェットを作った(ロングバージョン)
リアルFacebookガジェットを作った(ロングバージョン)
 
Ajax basic
Ajax basicAjax basic
Ajax basic
 
20111031 MobileWeb at TDC
20111031 MobileWeb at TDC20111031 MobileWeb at TDC
20111031 MobileWeb at TDC
 
AppExchangeパートナー&デベロッパー第2部:20070523版
AppExchangeパートナー&デベロッパー第2部:20070523版AppExchangeパートナー&デベロッパー第2部:20070523版
AppExchangeパートナー&デベロッパー第2部:20070523版
 

More from Kazuki Nakajima

ビーコンBotによるニュータイプな受付
ビーコンBotによるニュータイプな受付ビーコンBotによるニュータイプな受付
ビーコンBotによるニュータイプな受付Kazuki Nakajima
 
Apexで作成したrest apiをしっかり保護する方法
Apexで作成したrest apiをしっかり保護する方法Apexで作成したrest apiをしっかり保護する方法
Apexで作成したrest apiをしっかり保護する方法Kazuki Nakajima
 
Waterfall cafeで働くBot
Waterfall cafeで働くBotWaterfall cafeで働くBot
Waterfall cafeで働くBotKazuki Nakajima
 
AIが入った栄養士Botのアーキテクチャー
AIが入った栄養士BotのアーキテクチャーAIが入った栄養士Botのアーキテクチャー
AIが入った栄養士BotのアーキテクチャーKazuki Nakajima
 
AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法
AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法
AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法Kazuki Nakajima
 
畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分
畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分
畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分Kazuki Nakajima
 
無償のAPEXワークスペース取得方法
無償のAPEXワークスペース取得方法無償のAPEXワークスペース取得方法
無償のAPEXワークスペース取得方法Kazuki Nakajima
 
Oracle Cloudのjava実行環境
Oracle Cloudのjava実行環境Oracle Cloudのjava実行環境
Oracle Cloudのjava実行環境Kazuki Nakajima
 
実はDatabase cloudだけで実現できる巷で噂の機械学習とは?
実はDatabase cloudだけで実現できる巷で噂の機械学習とは?実はDatabase cloudだけで実現できる巷で噂の機械学習とは?
実はDatabase cloudだけで実現できる巷で噂の機械学習とは?Kazuki Nakajima
 
海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ
海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ
海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶKazuki Nakajima
 
鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る
鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る
鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知るKazuki Nakajima
 
Spring'15 ISV様向け新機能紹介
Spring'15 ISV様向け新機能紹介Spring'15 ISV様向け新機能紹介
Spring'15 ISV様向け新機能紹介Kazuki Nakajima
 
ビジネスアイデアを最速で形にできるApp exchange
ビジネスアイデアを最速で形にできるApp exchangeビジネスアイデアを最速で形にできるApp exchange
ビジネスアイデアを最速で形にできるApp exchangeKazuki Nakajima
 
活躍中のアプリケーションから紐解くForcecom
活躍中のアプリケーションから紐解くForcecom活躍中のアプリケーションから紐解くForcecom
活躍中のアプリケーションから紐解くForcecomKazuki Nakajima
 

More from Kazuki Nakajima (20)

ビーコンBotによるニュータイプな受付
ビーコンBotによるニュータイプな受付ビーコンBotによるニュータイプな受付
ビーコンBotによるニュータイプな受付
 
Apexで作成したrest apiをしっかり保護する方法
Apexで作成したrest apiをしっかり保護する方法Apexで作成したrest apiをしっかり保護する方法
Apexで作成したrest apiをしっかり保護する方法
 
Waterfall cafeで働くBot
Waterfall cafeで働くBotWaterfall cafeで働くBot
Waterfall cafeで働くBot
 
AIが入った栄養士Botのアーキテクチャー
AIが入った栄養士BotのアーキテクチャーAIが入った栄養士Botのアーキテクチャー
AIが入った栄養士Botのアーキテクチャー
 
AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法
AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法
AIを組み込んだ近未来のアプリケーションで感じる新しいサービスの新しい開発手法
 
畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分
畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分
畑と会話するニュータイプなIo tアプリで加熱中の技術トレンドを鷲掴みにする45分
 
無償のAPEXワークスペース取得方法
無償のAPEXワークスペース取得方法無償のAPEXワークスペース取得方法
無償のAPEXワークスペース取得方法
 
Oracle Cloudのjava実行環境
Oracle Cloudのjava実行環境Oracle Cloudのjava実行環境
Oracle Cloudのjava実行環境
 
実はDatabase cloudだけで実現できる巷で噂の機械学習とは?
実はDatabase cloudだけで実現できる巷で噂の機械学習とは?実はDatabase cloudだけで実現できる巷で噂の機械学習とは?
実はDatabase cloudだけで実現できる巷で噂の機械学習とは?
 
海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ
海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ
海外で人気沸騰中のIo tデバイスとdatabase cloudで構成するシンプルなiot構成を学ぶ
 
鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る
鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る
鳥肌必至のニューラルネットワークによる近未来の画像認識技術を体験し、IoTの知られざるパワーを知る
 
Spring'15 ISV様向け新機能紹介
Spring'15 ISV様向け新機能紹介Spring'15 ISV様向け新機能紹介
Spring'15 ISV様向け新機能紹介
 
ビジネスアイデアを最速で形にできるApp exchange
ビジネスアイデアを最速で形にできるApp exchangeビジネスアイデアを最速で形にできるApp exchange
ビジネスアイデアを最速で形にできるApp exchange
 
活躍中のアプリケーションから紐解くForcecom
活躍中のアプリケーションから紐解くForcecom活躍中のアプリケーションから紐解くForcecom
活躍中のアプリケーションから紐解くForcecom
 
Upwardのご紹介
Upwardのご紹介Upwardのご紹介
Upwardのご紹介
 
Salesforce1入門
Salesforce1入門Salesforce1入門
Salesforce1入門
 
Drawloop intro
Drawloop introDrawloop intro
Drawloop intro
 
Sugoisurvey intro
Sugoisurvey introSugoisurvey intro
Sugoisurvey intro
 
Rakumo intro
Rakumo introRakumo intro
Rakumo intro
 
Motionboard intro
Motionboard introMotionboard intro
Motionboard intro
 

Recently uploaded

モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...博三 太田
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?akihisamiyanaga1
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案sugiuralab
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfFumieNakayama
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfFumieNakayama
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineerYuki Kikuchi
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)Hiroshi Tomioka
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)UEHARA, Tetsutaro
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NTT DATA Technology & Innovation
 

Recently uploaded (9)

モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察  ~Text-to-MusicとText-To-ImageかつImage-to-Music...
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Music...
 
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
CTO, VPoE, テックリードなどリーダーポジションに登用したくなるのはどんな人材か?
 
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
TataPixel: 畳の異方性を利用した切り替え可能なディスプレイの提案
 
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdfクラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
クラウドネイティブなサーバー仮想化基盤 - OpenShift Virtualization.pdf
 
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdfAWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
AWS の OpenShift サービス (ROSA) を使った OpenShift Virtualizationの始め方.pdf
 
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
自分史上一番早い2024振り返り〜コロナ後、仕事は通常ペースに戻ったか〜 by IoT fullstack engineer
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
デジタル・フォレンジックの最新動向(2024年4月27日情洛会総会特別講演スライド)
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 

Tech talk salesforce mobile sdk

  • 1. Salesforce Mobile SDK ISV Architect, 中嶋 一樹
  • 2. Safe Harbor Safe 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 April 30, 2011. 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.
  • 3.
  • 6. Force.comと連携するiOSネイティブアプリのアーキテクチャ データベース Apex ③リクエスト API ①認証・認可 リソースサーバ 認証サーバ Force.com ②アクセストークン Salesforce Mobile SDK iOS SDK
  • 8. Mobile SDKのインストールとプロジェクト作成 Xcodeのインストール githubのレポジトリをクローン(ダウンロード) $ git clone https://github.com/forcedotcom/SalesforceMobileSDK-iOS.gt インストールスクリプトを実行 $ cd SalesforceMobileSDK-iOS/ $ ./install.sh Native Force.com REST Appテンプレートからプロジェクトを作成 *Use Automatic Reference Countingのチェックをはずす
  • 9. Mobile SDK Nativeテンプレートの構造 AppDelegate Consumer IDとCallback URLを設定 RootViewController 認証後のアプリケーションのメイン画面を制御 *サンプルアプリではユーザ名を10個取得し、テーブルビューに表示 SFAuthorizingViewController 認証画面を制御 SFNativeRestAppDelegate UIApplicationDelegateプロトコルに従い、アプリケーション起動から認証までの挙動を 担当
  • 10. SFNativeRestAppDelegate didFinishLauchingWithOptions:(NSDictionary *)launchOptions setupAuthorizingViewControllerをキック setupAuthorizingViewController rootViewControllerにSFAuthorizingViewControllerのインスタンスをセットし、アク ティブに loggedIn newRootViewControllerをキックしrootViewControllerに RootViewController(アプリのコントローラ)をセットし、アクティブに *newRootViewControllerはAppDelegateで実装されている
  • 11. RootViewController viewDidLoad メニューバーのタイトルをセット Force.comからユーザー名を10個取得 SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:@"SELECT Name FROM User LIMIT 10"]; [[SFRestAPI sharedInstance] send:request delegate:self]; didLoadResponse:(id)jsonResponse レスポンスをself.datarowsにセット cellForRowAtIndexPath:(NSIndexPath *)indexPath テーブルのセルをデキューまたは生成し、ユーザー名をセット
  • 12. UIApplicationDelegate UIAlertViewDelegate UIViewController UITableViewController SFAuthCoodinatorDelegate Subclass SFAuthorizingViewController Protocol SFNativeRestAppDelegate Subclass Subclass AppDelegate RootViewController Import Import SFRestAPI SFRestRequest
  • 13. CRUD操作 レコード作成 NSString *objectType = @"Contact"; NSDictionary *fields = [@"{FirstName:Kazuki, LastName:Nakajima}" JSONValue]; SFRestRequest *request = [[SFRestAPI sharedInstance] requestForCreateWithObjectType:objectType fields:fields]; [[SFRestAPI sharedInstance] send:request delegate:self]; レコード削除 NSString *objectId = @"1234567890"; NSString *objectType = @"Contact"; SFRestRequest *request = [[SFRestAPI sharedInstance] requestForDeleteWithObjectType:objectType objectId:objectId]; [[SFRestAPI sharedInstance] send:request delegate:self];
  • 16. Force.comと連携するiOSハイブリッドアプリのアーキテクチャ データベース Apex ③リクエスト API ①認証・認可 リソースサーバ 認証サーバ Force.com ②アクセストークン Force.com Javascript REST Toolkit Salesforce Mobile SDK iOS SDK
  • 18. プロジェクト作成 Hybrid Force.com Appテンプレートからプロジェクトを作成 *Use Automatic Reference Countingのチェックをはずす wwwフォルダを右クリックして一旦削除する ポップアップではRemove Referencesをクリック プロジェクトを右クリックしてshow in finderを選択し、wwwフォルダをドラッグ& ドロップでプロジェクトに追加する *Copy items into destination group’s folder (if needed)を選択 *Create folder references for any added foldersを選択 wwwフォルダが青色であることを確認する
  • 19. Mobile SDK Hybridテンプレートの構造 bootconfig.js Consumer IDとCallback URL等の設定を記述 forcetk.js Force.com JavaScript REST Toolkit。RESTアクセスのラッパー index.html アプリケーションのメイン画面 inline.js サンプルアプリの処理 SalesforceOAuthPlugin.js PhoneGapのAPIを利用して認証処理を実装 phonegap-x.x.x.js PhoneGapのAPIを提供
  • 20. bootconfig.js debugMode = true | false; logToConsoleメソッドの出力がスクリーンに表示されるかどうか remoteAccessConsumerKey = xxx; コンシューマ をセット oauthRedirectURI = [xxx] コールバックURLをセット oauthScopes = ['xxx','xxx']; 発行されるトークンの権限 startData = new SFHybridApp.LocalAppStartData(); | new SFHybridApp.RemoteAppStartData("[VFページのパス]"); コンテンツがローカル管理の場合はLocalAppStartData()をセット コンテンツがVisualforce管理の場合はRemoteAppStartData()をセット autoRefreshOnForeground = true | false; OAuthセッションを自動リフレッシュするかどうか
  • 21. index.html jQuery(document).ready(function(){} devicereadyイベント発生時にonDeviceReady()をキックすることを登録 onDeviceReady(){} SalesforceOAuthPlugin.getAuthCredentials()をキック salesforceSessionRefreshイベント発生時にsalesforceSessionRefreshed()をキックする ことを登録 reLinkClickHandlers()をキック(サンプルアプリのクリックイベントを登録) salesforceSessionRefreshed(){} forcetk.Clientのインスタンスを生成し、認証で得られたトークンをセット
  • 22. PhongeGap.plist *ファイルの場所はプロジェクト名 > Supporting Files > PhoneGap.plist ExternalHosts JavaScriptやCSSのライブラリを外部サーバから読み込む場合はドメインを明記する必要がある
  • 23. Force.com JavaScript REST Toolkit インスタンス生成 var forcetkClient = new forcetk.Client(clientId, loginUrl, proxyUrl); トークンセット forcetkClient.setSessionToken(sessionId, apiVersion, instanceUrl); レコード作成 forcetkClient.create(objtype, fields, callback, error); レコード削除 forcetkClient.del(objtype, id, callback, error); SOQL発行 forcetkClient.query(soql, callback, error); Apex Rest発行 forcetk.Client.apexrest(path, callback, error, method, payload, retry);
  • 24. PhoneGapで提供される機能 加速度センサー 位置情報 カメラ プッシュ通知 コンパス 音楽データ 連絡先 マイク ストレージ 回線 カメラ呼び出しの例 $j(document).on('tap', '#page_create_survey #button_capture_business_card', function(){ navigator.camera.getPicture(onCameraSuccess, onCameraFail, { quality: 50, destinationType: Camera.DestinationType.DATA_URL }); }); 各APIについて詳しくはhttp://docs.phonegap.com/en/1.6.1/index.htmlを参照