Firebase Rules:
For save data in Firebase storage and upload file,images,videos etc need to give permission
Firestore Database:
- On left hand side panel,go to build, select Firestore database.
-
Click on Create Database.
-
Then select mode wheather for live or debug mode need to use
-
Now click Rules tab
- Change condition by true
-
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if request.time true; } } } -
After doing true click on publish button so that you can access database.
Storage (FOR IMAGES, FILES, etc.. Upload permission):
- On left hand side panel,go to build, select storage.
-
Click on Storage.
-
Then select mode wheather for production or test mode need to use
-
Now click Rules tab
- Change condition by true
-
rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if true; } } } -
After doing true click on publish button so that you can access database.
Create Env Config in Firestore Database :
- For Access all the key like ChatGPT Key, Razor Key, Stripe Key, Admob key, etc. or hide any of the data like hide Admob or any Payment Method you have to store in Firestore Database.
-
After create Firestore as per above process complete, Go to left handel panel and select
Firestore
Firebase.
-
Now click Start Collection one pop-up open in that give collection id name :
config
-
Another pop-up will appear in that click on Auto-ID
-
Now add all below fields as it is given below and give value as per your project
requirement, or go to your
project -> lib -> models -> firebase_config.dart, in that all the fields name
are there copy the name and add
in firebase if you want to remove any field remove from model as well as do not add in
firebase store in
config
-
No. Fields -> datatype 1. balance -> number -> ///Free New user Balance (compulosry) 2. bannerAddId -> string -> Your Admob Android bannerAddId 3. bannerIOSId -> string -> Your Admob IOS bannerAddId 4. chatGPTKey -> string -> Your Chat GPT Api Key 5. facebookAddAndroidId -> string -> ///Your Facebook Id 6. facebookInterstitialAd -> string -> ///Your Facebook InterstitialId 7. facebookRewardAd -> string -> ///Your Facebook Rewared Id 8. interstitialAdIdAndroid -> string -> Your Admob InterstitialAndroidId 9. interstitialAdIdIOS -> string -> Your Admob InterstitialAdIdIOS 10. isAddShow -> bool -> true/false /// If you dont want to show Add just give false 11. isCameraEnable -> bool -> true/false /// If you want to show search from camera default just give true or else false in value 12. isChatHistory -> bool -> true/false /// If you dont want to show ChatHistory just give false 13. isChatShow -> bool -> /// If you want to hide the chat just give false or else true value in value 14. isGoogleAdmobEnable -> bool -> true/false /// If you dont want to show Google and show Facebook Ad just give false, if want to show Google Ad give true 15. isGuestLoginEnable -> bool -> true/false /// If you dont want to show Guest Login text in signin page just give false 16. isImageGeneratorShow -> bool -> true/false /// If you want to hide the image generate just give false or else true value in value 17. isRTL -> bool -> true/false /// If you dont want to show RTL in app 18. isTextCompletionShow -> bool -> true/false /// If you want to show Text Completion page default just give true or else false in value 19. isTheme -> bool -> true/false /// If you show Dark mode default 20. isVoiceEnable -> bool -> true/false /// If you want to show Voice Search page default just give true or else false in value 21. privacyPolicyLink -> string -> Your Privacy Policy Link /// If Privacy Policy is not there or don't want to keep then do not add in firebase and remove from model 22. rateAppAndroidId -> string -> Your Android Package Name (example : com.webiots.probotgpt) /// If Rate App is not there or don't want to keep then do not add
in firebase and remove from model 23. rateAppIOSId -> string -> Your IOS App Bundle Id (example : 742044692) /// If Rate App is not there in IOS or don't want to keep then do not add in firebase and
remove from model 24. refundLink -> string -> Your Refund Policy Link /// If Refund Policy is not there or don't want to keep then do not add in firebase and remove from model 25. rewardAndroidId -> string -> Your Admob RewardAndroidId 26. rewardIOSId -> string -> Your Admob RewardIOSId 27. rewardPoint -> number -> ///After watch how many reward point need to give 28. facebookAddIOSId -> string -> ///Your Facebook IOS Id 29. facebookInterstitialIOSAd -> string -> ///Your Facebook IOS InterstitialId 30. facebookRewardIOSAd -> string -> ///Your Facebook IOS Rewared Id
NOTE: You can Change All above value from Admin Panel.
-
Your Collection look like this
-
After add data in firebase call api firebase which using Stream from that data are store
in value as well in
storage. Where the data came from firebase automatic will apply that value.
-
Ex. Your Chat GPT API Key :
NOTE :
Add all keyword in firebase same as given below. If any keyword is not same as given
below then it will show error in app as same name couldn't find from firebase.