Firebase sms auto fill not working after app published to play store - flutter

looking for some help with the auto-fill OTP function for my app while using Firebase authentication service. Auto fill functionality works fine in test app as sms has the hash code. But when I publish the app on Google Playstore, the hash code in the OTP authentication sms is replaced by the app name, and hence the sms auto fill stops working as it requires the hash code. Will be great if someone has come across this problem and can help with some solution or workaround.
What's is the workaround to this

I faced the same issue and mine was due to the app name too long to contain the hash-code. Below are few work around:
You need to make sure the message you receive contains the hash of your app. Below is the right format :
123456 is your verification code for %APP_NAME%.
xyz_hascode_123
If your SMS does not contain the hashCode at the end, you might have to shorten your app name to less than 16 characters.
If your app is already published on Google Play, the name in the SMS will be the same as the one in the GooglePlayStore.
If you changed the name to 15 characters and the error still persists, you might have to wait for at least 24hours for the change to reflect on Firebase.
If after all the above it's still not resolved, please check if your receiver is well configured in the code.
Check out the new GooglePlay policy on app names: Common app names violations

Related

Firebase OTP SMS has two codes, one for verification and another that's always the same for all users [duplicate]

Used Firebase Phone Auth in my Android app.
The sms contains extra characters ntEc9wgP0/J at the end of the template.
Tried setting FirebaseAuth.getInstance().setLanguageCode("en")
Template language is set to English in Firebase console.
What can be the reason behind this?
This is my sms code template in firebase console.
%LOGIN_CODE% is your verification code for %APP_NAME%.
Firebase Phone Auth itself is working absolutely fine. What am I missing here?
EDIT : image of problem
EDIT2 : how it should be
I also faced the same issue in my case auto retrieval hash was only coming when otp sms length was below 53 characters so i contacted firebase support team regarding this .
As per firebase support team "If this is Android traffic then this is the appended auto-retrieval hash. We use the SMS Retriever API . So this extra characters are expected because these are the auto-retrieval hash"
** To Increase the character length you can change your app name on the google console.

Can you give a certain account a in app purchase for free on your google play app?

So I'm making this game in unity that I'm also publishing on google play. Now I wanted to give a free in app purchase to the first 10 people who donated to me on a different website. So then I emailed them a key, and so there's gonna be a form in the game that asks for the key and then if you submit it gets sent to my dev email.(reason why i'm not just using some file with keys is because I think it's insecure since people could find it) After I review it, then how do I give the user the IAP?
The method that I used in one of my projects was by adding certain codes to my databases on firebase And when the user puts the code you gave him, the script goes to the database and then checks if the code exists and if it does, it deletes it and gives the player the gift so he can't use it more than once.

AWS Lambda & Cognito - Updating user phone number attribute without sending an SMS

I am working on an iOS app using Amazon Web Services and I am setting up a user data base using the Cognito Userpool. During the sign up process, if a user enters the wrong phone number by mistake and in result isn't receiving a verification code, I am trying to allow them to then enter a new phone number, and update their phone number user attribute. Right now I am using a Lambda function which uses the AdminUpdateUserAttribute function, which is then connected to a APIGateway which allows me to run it from XCode. The function itself works and it successfully updates the phone number attribute.
Problem
The problem that I am running into though, is that after the phone number attribute has been updated with the Lambda function, a verification code is automatically sent to the newly updated phone number via SMS. The verification code is weird though because when I use that code to confirm the user, it doesn't work. Meaning that code is invalid for confirmation purposes. But if I use the Resend Confirmation Code function it will then send a valid confirmation code to the newly updated phone number.
Question
So I guess the questions I have are:
How can I prevent the automatic SMS from sending after I update the user's phone number attribute?
Or, is there a way I can use the verification code that is automatically sent as a confirmation code?
Thank you in advanced.

Push Notifications in Ionic 2

I am building a Chat application in Ionic 2, and need to implement Push Notifications.
Due to the fact that Google have recently moved their GCM service to rather use FCM, there is not much documentation how to implement an Ionic app with it. I have found the following tutorial which looks to do exactly what I need.
The tutorial seems good, however, I am confused on a few issues, and any help would be appreciated.
I am developing on a Windows machine, so currently just building for Android.
Question 1
I am confused with the following statement:
Build and run on real android and iOS devices to see device token in
console.
When I run ionic build android, it does not generate a device token in the console. Do you know how I can see what the device token is?
Or, is it just generated at run time by data.registrationId, and this is passed to the server?
push.on('registration', (data) => {
console.log("device token ->", data.registrationId);
//TODO - send device token to server
});
Question 2
In the Java,
static String API_KEY = "YOUR_GCM_API_KEY";
static String device_token = "YOUR_DEVICE_TOKEN";
For static String API_KEY = "YOUR_GCM_API_KEY";, is the YOUR_GCM_API_KEY the Server Key or Sender ID from FCM?
Is the static String device_token = "YOUR_DEVICE_TOKEN"; received from the Ionic app when you do this: console.log("device token ->", data.registrationId);? i.e. Is it passed from the client to the server?
Question 3
If we are sending separate messages to individual devices, e.g. for a Chat App, how do we differentiate between devices? Each chat message has an id associating it with a unique pair of users (e.g.[userId1,userId2]), but your example uses a device token, how do you send it for the unique user pair rather?
Question 4
I get the following at run time in the browser.
EXCEPTION: Error: Uncaught (in promise): TypeError: push.on is not a function
Can I ignore this? I suspect it is only happening in a browser and I won't get this error when it runs on a real devise.
UPDATE
It looks like all questions, apart from Question 3 have been answered below. I am guessing it can be done with some sort of pub/sub model on a key that's unique to the chat.
Question 1
It is a devise token passed from client to server: data.registrationId.
Question 2
YOUR_GCM_API_KEY is the Server Key generated by the FCM.
YOUR_DEVICE_TOKEN is passed from the client: data.registrationId.
Question 3
Not sure yet, am investigating further?
Question 4
The error can be ignored, it does not occur on a devise.
I haven't tried ionic before, but I'm gonna go on ahead and try to give my ideas with regards to your questions where I think some will be at the very least helpful:
Pretty sure that simply means to run the app on an actual device, not an emulator or a browser. Given the name, I think the reason why they're requiring to run an actual device is because maybe it is an ID that is retrieved from the device itself.
It's the Server Key. NOTE: You should ALWAYS keep the Server Key and Sender ID a secret.
For GCM/FCM one thing that is commonly used is a registration_token, which I think in this case, is the counterpart for the device token.
Not sure with this one. I did see this similar post, though it's still unresolved. Do look around the community, there might be another post similar to it.

iTunesConnect test user verifying

I create iTunes connect test user, but when I am trying to test in-app-purchase, my app in iOS simulator says, that i need to verify my apple id. How can I do it?
Text of error view:
You haven't verified your apple id.
Tap OK to see instructions.
When I taps OK, it hides alert view and it is end.
This has been happening to quite a lot of people in the last couple days and there is a thread in the Apple Dev Forums: https://devforums.apple.com/thread/128982?tstart=0
No need to verify it,
Actually its a dummy account for testing purpose. So, if you enter dummy email id which is not exist will be fine. And if you try to enter real email id, then it send you verification mail. But don't worry if you're not verify that that will work fine.
But better you should apply dummy email id instead your real email id to avoid this confusion...!?!
It's some times happens. But you can test in-app purchase with test user.
Just make sure below points:
1) You test the app in device (not simulator).
2) Before test the in-purchase, you should be logged out from app store on device.
Cheers.
I just ran into this issue and it seems there is a simple way to rectify the issue.
Issue:
After creating an Apple ID(best to use a fake email that doesn't exist to reduce headache) for a test user account in Albania, I signed out of the normal Apple ID I use from within "Settings>iTunes & App Stores" and leave it signed out.
Then I start the app I'm testing, attempt to purchase anything within the app, at which point I'm prompted with a message that asks to use existing Apple ID or Create New Apple ID.
I choose the Use Existing Apple ID option.
Then I'm prompted to enter email & password.
This is where you enter the test user account info you've created in iTunes Connect.
After entering the test user account info, a message saying that this profile/account has not been verified/used on this market previously, then I tap "OK", and it redirects me to the App Store.
At this point do not do anything further within the app store or the prompts that appear within it, it will just create further confusion/problems
Instead, back out of the store, and re-open the app your testing. At this point, try to purchase that same item again and it should work just fine.
I have no idea why it redirects you to the app store to begin with, but for whatever reason it does. It does seems strange that in-app purchase testing would ever re-direct you to the store, but it just does, so try to ignore the idiocy and move on. Just pretend it didn't happen, and go back into your app as if nothing happened and everything makes sense.
Hope this helps
We all have to file bug report to Apple so that it gets addressed faster. AFAIK Apple does not really care about discussions in their devforums.
And yes, I started experiencing the very same problem since Oct 21.
I found problem. Now we must use our real email and they will send email to verify it.