Socket
Book a DemoInstallSign in
Socket

nativescript-office365

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-office365

Office 365 Graph API plugin for NativeScript.

0.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Office 365 Graph API plugin for NativeScript

Office 365

Manage Office 365 Users, Groups, Mail, Calendars, Contacts, Files, Tasks, People, Notes and more — all from a single endpoint

Note: iOS only, for now

Features

For readability the supported features have been moved to their own README's:

  • Setup (continue reading below)
  • Authentication
  • Using via REST
  • Using via MS Graph Client

Prerequisites

You should have an Office 365 Account admin account. If you don't have one yet, you can get a free trial here.

Register your mobile app here. This will require you to login with your Office 365 account. You can then click the big "Add an app" button and go through the steps listed there, starting with giving you app a name. On the app creation screen, you need to do 3 things:

  • Click the "Add Platform" button and select "Mobile application"
  • Copy the "Client Id" GUID from the Mobile Application section.
  • Click "Save" at the bottom.

Setup

Add TypeScript to your NativeScript project if you don't already have it added. While this is not a requirement, it's highly recommended. If you want to watch a video on how to convert your existing JavaScript based NativeScript app to TypeScript, watch it here.

From the command prompt go to your app's root folder and execute:

tns plugin add nativescript-office365

Then open references.d.ts in the root of your project and add this line to get autocompletion and type-checking for this plugin:

/// <reference path="./node_modules/nativescript-office365/office365.d.ts" />

Usage

If you want a quickstart, get the demo app here.

Start-up wiring

We need to do some wiring when your app starts, so open app.ts and add this before application.start();:

TypeScript
import * as o365 from 'nativescript-office365';

var o365InitOptions : o365.InitOptions = {
    clientId: '<enter GUID here>', //client id for application (GUID)
    scopes: ['Files.ReadWrite']
};
o365.init(o365InitOptions);

Note 1: Enter the client id GUID value that was generated for you when you registered your app in the Prerequisites section.

Note 2: The scope listed above gives your NativeScript app SharePoint (OneDrive) file read/write permissions. Add/replace with other scope strings to give your app permissions to do other activities. More scopes are listed here

Future work

  • Add Android support
  • Add support for automatic auth token refresh for REST
  • Expose MS Graph Client to consumer

Credits

The starting point for this plugin was the NativeScript Plugin Seed by Nathan Walker. The MS Graph Client iOS version wouldn't have worked without the iOS ninja expertise of Jason Zhekov

Keywords

NativeScript

FAQs

Package last updated on 23 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.