Giter Site home page Giter Site logo

nativescript-office365's Introduction

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:

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:

  1. Click the "Add Platform" button and select "Mobile application"
  2. Copy the "Client Id" GUID from the Mobile Application section.
  3. 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

nativescript-office365's People

Contributors

alexziskind1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.