1.0.0 • Published 6 years ago

react-native-apns v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

react-native-apns

Getting started

$ npm install react-native-apns --save

Mostly automatic installation

$ react-native link react-native-apns

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-apns and add RNApns.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNApns.a to your project's Build PhasesLink Binary With Libraries
  4. In the AppDelegate.m add following:

#import "RNApns.h"

..... ......

// Required for the register event.

// Required for the registrationError event.

  1. Run your project (Cmd+R)<

Usage

import RNApns from 'react-native-apns';

// TODO: What to do with the module?

RNApns.getToken().then((token) => 
{
    console.log(`token${token}`);
    console.log('apns_token_success');
},
(error) => 
{
console.log('apns_token_failed');
console.log(error);
});