Google Nearby
This plugin adds support for the Google Nearby Messages API.
Repo: https://github.com/hahahannes/cordova-plugin-google-nearby
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-google-nearby --variable API_KEY="123456789" $ npm install --save @ionic-native/google-nearby@4
- Add this plugin to your app's module
Supported platforms
- Android
Usage
import { GoogleNearby } from '@ionic-native/google-nearby';
constructor(private googleNearby: GoogleNearby) { }
this.googleNearby.publish('Hello')
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
this.googleNearby.subscribe()
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
Instance Members
publish(message)
Publish a message
Param | Type | Details |
---|---|---|
message |
string
|
Message to publish |
Returns: Promise<any>
Returns a promise that resolves when the message got published
subscribe()
Subscribe to receive messages
Returns: Observable<any>
Returns an observable that emits received messages