Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/santoshanand/nativescript-salesforce-sdk
A type script plugin to get salesforce data
https://github.com/santoshanand/nativescript-salesforce-sdk
android ios manipulate-data nativescript nativescript-plugin oauth salesforce salesforce-data typescript
Last synced: about 2 months ago
JSON representation
A type script plugin to get salesforce data
- Host: GitHub
- URL: https://github.com/santoshanand/nativescript-salesforce-sdk
- Owner: santoshanand
- Created: 2017-06-25T00:39:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-20T17:51:10.000Z (over 7 years ago)
- Last Synced: 2024-11-13T12:17:47.130Z (3 months ago)
- Topics: android, ios, manipulate-data, nativescript, nativescript-plugin, oauth, salesforce, salesforce-data, typescript
- Language: TypeScript
- Size: 1.88 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Native Script Salesforce SDK
It is allows you to easily authenticate with Salesforce using OAuth (User Ajent flow), and to manipulate Salesforce data using a simple API.
## Features
- Asynchronous calls return ES6 promises
- Complete OAuth login workflow (User Agent)
- Automatically refreshes OAuth access_token (if available) on expiration
- API to manipulate data (create, update, delete, upsert)
- Works with Android and iOS## Installation
```
tns plugin add nativescript-salesforce-sdk
```## Uses
```javascript
let auth = new Auth(page); // must need to pass page object
let config:IWebAuth = {
clientId:'3MVG9YDQS5WtC11p8U6jHYOrOLWdUuHO5tK5jXMv0mQCyzZ0cdjYUd93RGSCpQdP87VL6hQbUO3fXYRmAkJxq',
calbackUrl:'ns://nativescript/sdk',
loginUrl:'https://login.salesforce.com'
};
auth.on('success', (args)=> {
// Query
Apex.query('select id, Name from Account')
.then((data)=> {
// console.log(JSON.stringify(data.content.toJSON().totalSize));
if(model !== undefined) {
model.items = data.content.toJSON().records;
}
}).catch((err) => {
console.log(JSON.stringify(err));
});
});
auth.on('fail', (args)=> {
console.log('fails '+new Date().getMilliseconds());
});
auth.login(config);```
Please check [demo application](https://github.com/santoshanand/sample-nativescript-salesforce-sdk)