神刀安全网

Building an Ionic2 App with the Salesforce Mobile SDK

Building an Ionic2 App with the Salesforce Mobile SDK

Ionic 2 is catching up fairly quickly and Salesforce is not far behind on writing wrapper and plugins to match ionic framework updates. We recently started playing with ionic 2 for building Andriod and iOS application and to kick start I found neat blog written by my ex- colleague +Christophe Coenraets here

, you will find him, writing on fledgling tech all through the time.

Trialhead have written a module for kick start on ionic 2 with Salesforce data resource. Since I have finished few module and went through building few applications, I am share basic step by step guide to run through and write your first up and running using ionic  and mobile sdk over Salesforce.

Lets get started

1. Install ionic on your mac 

$ sudo npm install -g ionic@beta  

2. Install Cordova

$ sudo npm install -g cordova

3. Then run

$ ionic start myApp salesforce $ cd myApp $ ionic platforms update ios $ ionic plugin add https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin

4. To run latest emulator, you might need to also install latest of emulator so type

$ npm install -g ios-sim

Running Application in Emulator

To run project in emulator, lets us build the project first

Build Project

$ ionic build ios 

Run project on emulator

$ ionic emulate ios

Pass on your org credentials and verify authenticity though passcode that you might receive on your registered email and if went successfully you can see application running on emulator smoothly.

Building an Ionic2 App with the Salesforce Mobile SDK

Running application on Browser 

Salesforce have cross origin reference restrictions so it will not allow a locally hosted application to make a server level API call to salesforce and for that you might need to make to pull data. For that you need a proxy server running to make a call for you. You can use Force Server which comes in package of Proxy Server and Local Web Server.

Install ForceServer

$ sudo npm install -g force-server 

Navigate your www directory of your current project

Building an Ionic2 App with the Salesforce Mobile SDK

$ cd www/

Run application locally by starting server

$ force-server

This will open a pop-up for authentication and will run your application as shown below

Building an Ionic2 App with the Salesforce Mobile SDK

Stay tuned for more update on ionic2 with Salesforce

Technical Architect (Cloud Operations) at Intuitive Surgical Inc , building worlds smartest and larget surgical robots and binding business systems with cloud. I’m Founder of OyeCode

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Building an Ionic2 App with the Salesforce Mobile SDK

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮