# syncrow_app

This is the mobile application project, developed with Flutter for Syncrow IOT Project..

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

## Development Process

1- You'll receive a task assignment in Jira that's been assigned to you.

2- In Jira, change the status of the task to "in progress".

3- Create a new branch for the task using the command "git checkout -b task_number".

4- Make your changes and commit them using the command "git commit -m 'Add my changes'".

5- Push your changes to the task branch using the command "git push origin task-branch".
Open a pull request on the DEV branch and add a reviewer to it.

6- Once the reviewer approves your pull request, merge your changes into the DEV branch.

7- Use the command "git checkout DEV" to switch to the DEV branch.

8- Upload apk file and ipa file to Firebase distribution (you can find the steps to upload your app to Firebase Distribution for both Android and iOS platforms in the Deployment section).

9- Update the task status in Jira to "QA".   
## Deployment

### Android

**- Firebase Distribution:**

To test the app, we use Firebase Distribution to send testing builds of the app to the testers.

- Create an Android build for testing with the command: `flutter build apk --flavor prod -t lib/main.dart`.

- Upload the apk file to Firebase distribution

**- Google Play Store:**

1- To create an APK file from your Flutter project, you can use the command: `flutter build apk --release`

2- Upload your APK file to the Google Play Console and provide all necessary information about the release, such as release notes and version number.

3- Submit your app for review, which can take several days to complete. Once your app is approved, it will be available for download on the Google Play Store.

### iOS

**- Firebase Distribution:**

To test the app, we use Firebase Distribution to send testing builds of the app to the testers.

1- Create an iOS for testing with the command: `flutter build ios --flavor prod -t lib/main.dart`.

2- Create an archive of your app: Open Xcode and go to the "Product" menu, then select "Archive" to create an archive of your app. Make sure to select the "Generic iOS Device" as the build destination.

3- Once the archive is complete, go to the "Organizer" window and select the archive you just created and click on the "Distribute App" button.

4- Choose "Ad Hoc" as the distribution method and click "Next".

5- Choose the appropriate signing identity and click "Export".

6- Choose a location to save the exported app and click "Save".

7- Your HOC build is now ready to be signed and uploaded to Firebase Distribution.

8-  Upload the ipa file to Firebase distribution

You can also create an archive through these commands lines:

1- Create an iOS for testing with the command: `flutter build ios --flavor prod -t lib/main.dart`.

2- Create an archive with this command: `xcodebuild -workspace Runner.xcworkspace -scheme Runner -archivePath "build/Runner.xcarchive" archive`.

3- Export the ipa file with this command: `-exportArchive -archivePath "build/Runner.xcarchive" -exportPath "build/exported_ipas" -exportOptionsPlist "build/ExportOptions.plist"`

**- Apple Store**

1- Build your app: Use Flutter to build your app for release. To build your app for iOS, use the command: `flutter build ios --release --no-codesign`

Note: The --no-codesign flag will tell Flutter not to sign your app, since you'll be doing that later with Xcode.

2- Create an archive of your app: Open Xcode and go to the "Product" menu, then select "Archive" to create an archive of your app. Make sure to select the "Generic iOS Device" as the build destination.

3- Validate and upload your app: Once the archive is created, Xcode will automatically open the Organizer window. Select the archive you just created and click the "Validate App" button to validate your app. Once the validation process is complete, click the "Distribute App" button to upload your app to the App Store Connect.

4- Submit your app for review: After uploading your app, you'll need to submit it for review by Apple. This process can take several days, and you'll be notified by email once your app is approved or rejected.
