How to use Google Analytics in Ionic 3? - ionic-framework

I want to implement Google Analytics in my application to know how many users access my application in real time, but I'm having some difficulties. In the Google Analytics panel, the following message appears (in Portuguese):
And I'm following Ionic's documentation, but I can not add in my application, could someone give me a "north" about it?
And this is code of documentation
import { GoogleAnalytics } from '#ionic-native/google-analytics';
constructor(private ga: GoogleAnalytics) { }
...
this.ga.startTrackerWithId('YOUR_TRACKER_ID')
.then(() => {
console.log('Google analytics is ready now');
this.ga.trackView('test');
// Tracker is ready
// You can now track pages or set additional information such as AppVersion or UserId
})
.catch(e => console.log('Error starting GoogleAnalytics', e))

Related

Swift Stripe Connect how to implement account creation

I'm seriously struggling to create a Stripe Connect account from my IOS Application using swift and firebase. I can't seem to find any documentation on how this would be possible. I creating an app which allows users to do jobs for each other which of course means pay each other. How can I implement this in my app?
I think onboarding users is the biggest difficulty in iOS because(as far as I know) their are only two ways to do this. One, is to use Stripe Onboarding which requires you to take your user to a link where stripe onboards for you. The other, option is building out your own UI flow to manually collect all the information yourself and update their account through the Stripe API.
However, creating an account is simple. Here is an example of it implemented in Node.js!
stripe.accounts.create(
{
type: 'standard',
country: 'US',
email: email,
requested_capabilities: [
'card_payments',
'transfers',
],
},
function(err, account) {
if (err) {
console.log("Couldn't create stripe account: " + err)
reject(err)
}
console.log("ACCOUNT: " + account.id)
response.body = {success: account.id}
return res.send(response)
}
);
stripe.dev/stripe-ios/docs

Is it possible to implement "OK Google" like functionality using Ionic

I am trying to build an app like Alex or Google Home, suppose a user says "Hey MyApp", mic should be opened or a function associated with the button should be invoked automatically
I have tried API.ai and Ionic TTS plugins, but not able to find anything to enable native features using voice commands in Ionic.
yes you can do it using Ionic Speech recognition this
ionic cordova plugin add cordova-plugin-speechrecognition
npm install #ionic-native/speech-recognition
add it module
then run
import { SpeechRecognition } from '#ionic-native/speech-recognition/ngx';
constructor(private speechRecognition: SpeechRecognition) { }
...
// Check feature available
this.speechRecognition.isRecognitionAvailable()
.then((available: boolean) => console.log(available))
// Start the recognition process
this.speechRecognition.startListening(options)
.subscribe(
(matches: string[]) => console.log(matches),
(onerror) => console.log('error:', onerror)
)
// Stop the recognition process (iOS only)
this.speechRecognition.stopListening()
// Get the list of supported languages
this.speechRecognition.getSupportedLanguages()
.then(
(languages: string[]) => console.log(languages),
(error) => console.log(error)
)
// Check permission
this.speechRecognition.hasPermission()
.then((hasPermission: boolean) => console.log(hasPermission))
// Request permissions
this.speechRecognition.requestPermission()
.then(
() => console.log('Granted'),
() => console.log('Denied')
)
Call voice recognition function inside constructor & build the app and install.
And then say ok Google open ( your app name)
Google assistant open your app and voice recognition fiction will be automatically trigger.

Actions on Google new SignIn() is cancelling before user can give input

We are creating an Action on Google using Dialogflow V2 API. We are using firebase cloud functions for our fulfillment and we are using an external rest api for our crud operations.
We have an undeployed action that I have tested in the simulator. The conversation flow is
The user is prompted to signin ie, new SignIn()
They are asked what they want to do and they respond
Their response is saved in our backend using their credentials
new SignIn() works in the simulator, but when I test on the Google Home Mini the SignIn() responds as if the user has rejected the propmpt to signin before they have time to respond
Is there some restriction regarding testing an Action that include Account Linking on the Google Home Mini?
The intent containing the new SignIn() is my Welcome intent, could that be causing the issue?
Here are the two intents handling SignIn(). Start Signin Intent is triggered by the Welcome Event
app.intent("Start Signin", (conv) => {
conv.ask(new SignIn());
});
app.intent("Get Signin", (conv, params, signin) => {
if (signin.status === "OK") {
const payload = conv.user.profile.payload;
conv.ask(`I got your account details, ${payload.name}. What do you want to do?`);
} else {
conv.ask(`I won't be able to save your data, please login`);
}
});

How To Get BirthDate or Gender In Google Plus Login Ionic3?

How To Get BirthDate or Gender In Google Plus Login Ionic3 ?
GPLogin(){
this.googlePlus.login({'scopes': 'https://www.googleapis.com/auth/plus.login'})
.then(res => {
console.log(res);
alert("success "+JSON.stringify(res));
})
.catch(err => {
console.error(err);
alert("error "+JSON.stringify(err));
});
}
You should take a look at the google plus cordova plugin documentation.
If You search for scope, You will find what You are looking for. You need to add Your required scopes to be able to get the users profile data.
A complete list of all google scopes can be found here
In Your case it should be the Google People API, v1.
https://www.googleapis.com/auth/user.birthday.read = View your complete date of birth.
But beware of the known bugs related to the scope feature.

How to implement Google OAuth in an Ionic 2 app?

I need to add Google login in my Ionic v2 app.
Currently I cannot use the Ionic Authentication service because it's not ready for v2 yet.
I've also tried the ng2-cordova-oauth plugin but I cannot use ionic serve or Ionic View to test the authentication which is a huge inconvenience for me because I no longer have an easy way to show the app to the client.
So... any alternative?
Firebase user authentication is an alternative , you can implement google authentification with few lines of code
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
ref.authWithOAuthPopup("google", function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload:", authData);
}
});
please see the documentation here firebase documentation