Google Nearby

Improve this doc

This plugin adds support for the Google Nearby Messages API.

Repo: https://github.com/hahahannes/cordova-plugin-google-nearby

Installation

  1. 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
    
  2. Add this plugin to your app's module

Supported platforms

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 recieve messages

Returns: Observable<any> Returns an observable that emits recieved messages

API

Native

General