Skip to content

Commit

Permalink
package number updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravds committed Apr 17, 2024
1 parent 6de9429 commit 1a95fa8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
86 changes: 43 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# react-native-quick-firebase

![](https://img.shields.io/badge/Stable-v1.1.1-green.svg?style=flat)
![](https://img.shields.io/badge/RN-v0.59.x+-orange.svg?style=flat)
![](https://img.shields.io/badge/Stable-v1.1.4-green.svg?style=flat)
![](https://img.shields.io/badge/RN-v0.65.x+-orange.svg?style=flat)

Firebase simple integration with phone auth and analytics only.

Implementation in React Native project

Please add this entries as follow -

- _iOS_ ( In Podfile)
- _iOS_ ( In Podfile)

```
pod 'RNQuickFirebase', :path => PROJECT_PATH + 'react-native-quick-firebase/ios'
pod 'Firebase/Auth'
pod 'FirebaseAnalytics'
```

- _Android_
- _Android_

android/settings.gradle

Expand Down Expand Up @@ -59,50 +59,50 @@ public class MainApplication extends Application implements ReactApplication {
// Copyright © 2017-Present, Gaurav D. Sharma
// All rights reserved.
//
'use strict';
'use strict'

import React, { Component } from 'react';
import { AppRegistry, Text, TouchableOpacity, View } from 'react-native';
import RNQuickFirebase from 'react-native-quick-firebase';
import React, { Component } from 'react'
import { AppRegistry, Text, TouchableOpacity, View } from 'react-native'
import RNQuickFirebase from 'react-native-quick-firebase'

class App extends Component {
componentDidMount() {
RNQuickFirebase.setAnalyticsEnabled(true);
}

onSendOTP = async () => {
RNQuickFirebase.logEvent('otp_button_click', null);
let params = null;
try {
const phoneNumber = '+919876543210';
await RNQuickFirebase.sendOTP(phoneNumber);
console.warn('otp sent to: ' + phoneNumber);
const sessionToken = await RNQuickFirebase.validateOTP('123456');
console.warn('OTP validated successfully with sessionToken: ' + sessionToken);
params = { otp_validate_event: 'otp_success' };
RNQuickFirebase.logEvent('otp_send_validate', params);
/// send this token to server to cross validate
RNQuickFirebase.signOut();
console.warn('User Logout from the Firebase');
} catch (e) {
console.warn(e);
params = { ['otp_send_event']: 'otp_failed' };
RNQuickFirebase.logEvent('otp_send_validate', null);
}
};

render() {
return (
<View style={{ flex: 1, backgroundColor: 'white', justifyContent: 'center', alignItems: 'center' }}>
<TouchableOpacity onPress={this.onSendOTP}>
<Text>Check RNQuickFirebase App</Text>
</TouchableOpacity>
</View>
);
}
componentDidMount() {
RNQuickFirebase.setAnalyticsEnabled(true)
}

onSendOTP = async () => {
RNQuickFirebase.logEvent('otp_button_click', null)
let params = null
try {
const phoneNumber = '+919876543210'
await RNQuickFirebase.sendOTP(phoneNumber)
console.warn('otp sent to: ' + phoneNumber)
const sessionToken = await RNQuickFirebase.validateOTP('123456')
console.warn('OTP validated successfully with sessionToken: ' + sessionToken)
params = { otp_validate_event: 'otp_success' }
RNQuickFirebase.logEvent('otp_send_validate', params)
/// send this token to server to cross validate
RNQuickFirebase.signOut()
console.warn('User Logout from the Firebase')
} catch (e) {
console.warn(e)
params = { ['otp_send_event']: 'otp_failed' }
RNQuickFirebase.logEvent('otp_send_validate', null)
}
}

render() {
return (
<View style={{ flex: 1, backgroundColor: 'white', justifyContent: 'center', alignItems: 'center' }}>
<TouchableOpacity onPress={this.onSendOTP}>
<Text>Check RNQuickFirebase App</Text>
</TouchableOpacity>
</View>
)
}
}

AppRegistry.registerComponent('firebaseDemo', () => App);
AppRegistry.registerComponent('firebaseDemo', () => App)
```

Voila! Happy Coding! 😍
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-quick-firebase",
"version": "1.1.2",
"version": "1.1.4",
"author": "Gaurav D. Sharma <[email protected]>",
"description": "Quick firebase integration with phone auth and analytics",
"homepage": "https://github.com/dayitv89/react-native-quick-firebase",
Expand Down

0 comments on commit 1a95fa8

Please sign in to comment.