How to make a member signup/login in Sketchware

You can also make Signup/login with email verification


To make a Signup/login (register/login) Activity in Sketchware, follow steps given below.

1. Make a new activity with name verify_email.xml 
2. Make components in both, i for intent fauth for Firebase auth
Note: please make sure the name for Firebase auth is correct and your app is connected with Firebase.
3. In main.xml, add 2 edittext and 1 button btn_Signup,edit_email,edit_password. 
4. In onCreate event of main.xml add if Firebase auth fauth is logged in then setScreen home.xml or home activity of your app and startActivity i also the finish activity block.
Note: here, you have to use intent i component


5. In main.xml button Register onClick event add blocks as shown bellow

6. In main.xml, fauth:onCreate Account user complete event, use "if-else" block. If block add success bolean block which is already given because of event type. In if success then block, use blocks to move to verify_email.xml. and in "else" condition, use "toast" block. The toast block must contain error message string block, which is already given.


Now go to verify_email.xml.
7. Add 2 edittexts same as added in main.xml and also a login button same as added in main.xml.
8. In btn_login onClick event, add blocks as shown below
In place of createUserWith Email block, use singinwith Email and password block.
9. In onSigninUserComplete, add blocks as shown in image below.
Note: make sure to add a login button in main.xml, which moves the user to verify_email.xml.



10. Save and run the project


Comments

Post a Comment

Popular posts from this blog

Chat app project in Sketchware

How to make edittext in dialog in Sketchware

How to use request network for webview in Sketchware