SlideShare a Scribd company logo
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.
Tech talk   salesforce mobile sdk
ネイティブアプリ
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

PDF
ちゃんと理解するForce.com canvas
PDF
Force.com canvas入門ガイド
PDF
Force.com Canvas アプリケーション
PPTX
Sf素人が2週間でアプリケーションビルダーに挑戦してみた
PDF
勉強会force#3 iOSアプリ開発
PPTX
Lightingコンポーネントベーシック開発
PDF
About Chrome web store
PDF
キャンバス個人用アプリ 速習ガイド
ちゃんと理解するForce.com canvas
Force.com canvas入門ガイド
Force.com Canvas アプリケーション
Sf素人が2週間でアプリケーションビルダーに挑戦してみた
勉強会force#3 iOSアプリ開発
Lightingコンポーネントベーシック開発
About Chrome web store
キャンバス個人用アプリ 速習ガイド

What's hot (20)

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

Similar to Tech talk salesforce mobile sdk (20)

PDF
Salesforce Platform Mobile Serviceを使ったアプリ開発
PDF
勉強会force#2 HTML5によるモバイルアプリ開発
PDF
Salesforce1 platformで爆速モバイル開発
PDF
Touch Platform によるモバイルアプリケーション開発
KEY
スマートフォンアプリケーション開発の最新動向
PDF
Salesforce Platformとモバイル活用
PDF
App Cloud モバイルアプリ開発戦略
PDF
コンポーネントを”つなぐ”時代へ Web&Mobileアプリ開発最新動向
PDF
Enterpriseでもモバイル開発
PDF
1 power night2014_imaoka
PDF
App exchange conference facebookがビジネスアプリに与えるインパクト
PDF
Webエンジニアがラクして企業向けモバイルアプリを作る方法 ~Salesforce1モバイルコンテナを使った開発手法~
PDF
Salesforce1 Platformモバイル開発Tips Webinar
PPTX
Salesforce1開発(s1 tour)
PDF
Salesforce1モバイルアプリケーション開発概要
PDF
Chatterを使ったカスタムソーシャル
PPTX
Monacaでつくるハイブリッドアプリ
PDF
Force.comとモバイルでイベント管理実例
PPT
iPhoneコンシェルジュアプリ
PPT
iPhoneコンシェルジェアプリの紹介
Salesforce Platform Mobile Serviceを使ったアプリ開発
勉強会force#2 HTML5によるモバイルアプリ開発
Salesforce1 platformで爆速モバイル開発
Touch Platform によるモバイルアプリケーション開発
スマートフォンアプリケーション開発の最新動向
Salesforce Platformとモバイル活用
App Cloud モバイルアプリ開発戦略
コンポーネントを”つなぐ”時代へ Web&Mobileアプリ開発最新動向
Enterpriseでもモバイル開発
1 power night2014_imaoka
App exchange conference facebookがビジネスアプリに与えるインパクト
Webエンジニアがラクして企業向けモバイルアプリを作る方法 ~Salesforce1モバイルコンテナを使った開発手法~
Salesforce1 Platformモバイル開発Tips Webinar
Salesforce1開発(s1 tour)
Salesforce1モバイルアプリケーション開発概要
Chatterを使ったカスタムソーシャル
Monacaでつくるハイブリッドアプリ
Force.comとモバイルでイベント管理実例
iPhoneコンシェルジュアプリ
iPhoneコンシェルジェアプリの紹介
Ad

More from Kazuki Nakajima (20)

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

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.
  • 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を参照