Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Feature request: Invites #199 (docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Jun 4, 2017
1 parent a1fede7 commit 2e7638e
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.idea
.vscode
platforms/android/libraryproject/
platforms/ios/typings/
docs
README.md
CHANGELOG.md
node_modules
*.tgz
node_modules
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ For readability the supported features have been moved to their own README's:
* [Storage](docs/STORAGE.md)
* [Crash Reporting](docs/CRASHREPORTING.md)
* [Analytics](docs/ANALYTICS.md)
* [Invites](docs/INVITES.md)
* [AdMob](docs/ADMOB.md)

## Prerequisites
Expand Down Expand Up @@ -138,7 +139,7 @@ firebase.init({
```

#### Pod dependency error
If you see an error like `Unable to satisfy the following requirements: Firebase (~> 3.13.0) required by Podfile`,
If you see an error like `Unable to satisfy the following requirements: Firebase (~> 3.17.0) required by Podfile`,
then run `pod repo update` on the command line to make sure you have the latest Podspec.

This could happen when updating the plugin to a new version. You'll want to `tns platform remove ios && tns platform add ios` as well to clean out the old pod version.
Expand Down
2 changes: 1 addition & 1 deletion docs/ADMOB.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/admob.png" height="85px" alt="AdMob"/>

## Enabling AdMob
Since plugin version 3.10.0 you can use Firebase _AdMob_ features.
Expand Down
4 changes: 1 addition & 3 deletions docs/ANALYTICS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>

<img src="images/features/analytics.png" width="296px" height="124px" alt="Analytics"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/analytics.png" height="85px" alt="Analytics"/>

## Enabling Analytics
This plugin has had enalytics enabled since day 1 to collect usage and behavior data for your app. However, you were not able to push your own events. That changed with version 3.6.0 😃🔥
Expand Down
4 changes: 1 addition & 3 deletions docs/AUTHENTICATION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>

<img src="images/features/auth.png" width="296px" height="124px" alt="Auth"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/auth.png" height="85px" alt="Authentication"/>

## Enabling Authentication
You can sign in a user either
Expand Down
4 changes: 1 addition & 3 deletions docs/CRASHREPORTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>

<img src="images/features/crash.png" width="296px" height="124px" alt="Crash"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/crash.png" height="85px" alt="Crash Reporting"/>

## Enabling Crash Reporting
With plugin version 3.9.0+ you will be prompted during installation of the plugin to enable Crash Reporting (it's off by default).
Expand Down
4 changes: 1 addition & 3 deletions docs/DATABASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>

<img src="images/features/database.png" width="296px" height="124px" alt="Database"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/database.png" height="85px" alt="Realtime Database"/>

If you can spare 41 seconds, check (an older version of) this plugin's [demo app](https://github.com/EddyVerbruggen/nativescript-plugin-firebase-demo) in action:
[![YouTube demo, 41 sec](images/yt-thumb-database.png)](https://youtu.be/7zYU5e0Djkw "YouTube demo, 41 sec")
Expand Down
64 changes: 64 additions & 0 deletions docs/INVITES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/invites.png" height="85px" alt="Invites"/>

## Enabling Invites
Since plugin version 3.12.0 you can use Firebase _Invites_ features.

_Invites_ lets you invite other users to your app from right within your own app, via SMS and/or Email.

### iOS
* On iOS the user must be signed in with their Google Account to send invitations.
* You must have the App Store ID set in your developer console project in order for invitations to successfully be sent.
* For more details see [https://firebase.google.com/docs/invites/ios](https://firebase.google.com/docs/invites/ios).

#### Contacts Usage Permission
Open `app/App_Resources/iOS/Info.plist` and add this somewhere in the file (if it's not already there):

```xml
<key>NSContactsUsageDescription</key>
<string>For inviting others to use this app.</string>
```

## Functions

### invites.sendInvitation

```js
firebase.invites.sendInvitation({
title: "Invite title here",
message: "Invite message here"
}).then(
function (result) { // SendInvitationResult
console.log(result.count + "invitations sent, ID's: " + JSON.stringify(result.invitationIds));
},
function (error) {
console.log("sendInvitation error: " + error);
}
);
```

The options you can pass to `sendInvitation` are:

|param|optional|description
|---|---|---
|`title`|no|Invitation title you want to send.
|`message`|no|Sets the default message sent with invitations.
|`deepLink`|yes|Sets the link into your app that is sent with invitations.
|`callToActionText`|yes|Sets the call-to-action text of the button rendered in email invitations. Cannot exceed 32 characters.
|`customImage`|yes|Sets the URL of a custom image to include in email invitations. The image must be square and around 600x600 pixels. The image can be no larger than 4000x4000 pixels.
|`androidClientID`|yes|If you have an Android version of your app and you want to send an invitation that can be opened on Android in addition to iOS.
|`iosClientID`|yes|You can find your iOS app's client ID in the GoogleService-Info.plist file you downloaded from the Firebase console.


### invites.getInvitation
When the user opens your app from an invite, you can retrieve the details via the `getInvitation` function:

```js
firebase.invites.getInvitation().then(
function (result) { // GetInvitationResult
console.log("deeplink: " + result.deeplink + ", invitationId: " result.invitationId);
},
function (error) {
console.log("getInvitation error: " + error);
}
);
```
4 changes: 1 addition & 3 deletions docs/MESSAGING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>

<img src="images/features/notifications.png" width="296px" height="124px" alt="Notifications"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/notifications.png" height="85px" alt="Notifications"/>

## Enabling Firebase Cloud Messaging (FCM)
Version 3.3.0 of this plugin added FCM support (which is the successor of GCM).
Expand Down
3 changes: 1 addition & 2 deletions docs/REMOTECONFIG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/config.png" height="85px" alt="Remote Config"/>

<img src="images/features/config.png" width="296px" height="124px" alt="Config"/>

## Enabling Remote Config
Since plugin version 3.2.0 you can retrieve _Remote Config_ properties.
Expand Down
3 changes: 1 addition & 2 deletions docs/STORAGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<img src="images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
<img src="https://raw.githubusercontent.com/EddyVerbruggen/nativescript-plugin-firebase/master/docs/images/features/storage.png" height="85px" alt="Storage"/>

<img src="images/features/storage.png" width="296px" height="124px" alt="Storage"/>

## Enabling Storage
Since plugin version 3.4.0 you can use Firebase _Storage_ features.
Expand Down
Binary file added docs/images/features/admob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/features/appindexing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/crash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/dynamiclinks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/features/invites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/notifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/features/performancemonitoring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/features/storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions firebase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,12 @@ export module invites {

export interface SendInvitationOptions {
/**
* Invitation title you want to send
* Invitation title you want to send.
*/
title: string;

/**
* Sets the default message sent with invitations
* Sets the default message sent with invitations.
*/
message: string;

Expand All @@ -651,12 +651,12 @@ export module invites {
customImage?: string;

/**
* If you have an Android version of your app and you want to send an invitation that can be opened on Android in addition to iOS
* If you have an Android version of your app and you want to send an invitation that can be opened on Android in addition to iOS.
*/
androidClientID?: string;

/**
* You can find your iOS app's client ID in the GoogleService-Info.plist file you downloaded from the Firebase console
* You can find your iOS app's client ID in the GoogleService-Info.plist file you downloaded from the Firebase console.
*/
iosClientID?: string;
}
Expand Down

0 comments on commit 2e7638e

Please sign in to comment.