Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Handle file upload from mobile OS to Drive and Mespapiers #906

Merged
merged 62 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8d7b16e
feat: implement sharing files navigation (android)
acezard Aug 14, 2023
64bc14b
fix: delete unused file and useEffect
acezard Aug 14, 2023
c4e2a1c
feat: refactor and add tests
acezard Aug 14, 2023
178e024
feat: improve app intent reactivity
acezard Aug 15, 2023
e653461
feat: fix race conditions and data fetching
acezard Aug 16, 2023
072e1d7
chore: install share extension on iOS
acezard Aug 16, 2023
84377c2
feat: handle iOS event
acezard Aug 16, 2023
ccc5b81
feat: remove logic from hook and improve flow
acezard Aug 16, 2023
61e830c
fix: remove RN patch (needed it for iOS build)
acezard Aug 16, 2023
db211ad
feat: define the new SharingProvider
acezard Aug 17, 2023
6ce6448
feat: refactor flow into top-down hierarchy
acezard Aug 17, 2023
5815d47
fix: use @mythologi/rn-receive-sharing-intent
acezard Aug 17, 2023
61a81a4
fix: improve readability and ram cleanup
acezard Aug 18, 2023
fbfba8b
feat: implement webapp routing
acezard Aug 18, 2023
51e2e23
feat: implement error handling
acezard Aug 21, 2023
9589db6
refactor: handle full flow lifecycle
acezard Aug 21, 2023
a5e0e4b
chore: fix tests
acezard Aug 22, 2023
2b76ba0
feat: implement file upload and communication
acezard Aug 22, 2023
8de4108
temp commit
acezard Aug 25, 2023
3c712cf
feat: stabilise upload API with post-me
acezard Aug 29, 2023
964c5bc
feat: improve hasFilesToHandle
acezard Aug 30, 2023
a3445d7
fix: update test, types and fix lint
acezard Aug 30, 2023
cb443dc
fix: add global kotlin version
acezard Aug 30, 2023
417c41b
refactor: rename sharing to osReceive
acezard Aug 30, 2023
89a6a24
refactor: rename sharing to osReceive
acezard Aug 30, 2023
8a2e58e
fix: update registry query to standards
acezard Aug 30, 2023
d03f8d5
fix: improve edge cases
acezard Sep 3, 2023
1c45399
doc: update feature information
acezard Sep 4, 2023
ce81c31
refactor: make receivescreen a modal
acezard Oct 3, 2023
fa810ed
refactor: remove all mentions of intentStatus
acezard Oct 3, 2023
c82666f
fix: improve responsiveness to sequential uploads
acezard Oct 4, 2023
3d29983
refactor: simplify upload state
acezard Oct 9, 2023
48cf8b5
feat: implement app choice for file upload
acezard Oct 11, 2023
b77ce30
feat: fix post-me promise return value
acezard Oct 12, 2023
5773de7
feat: Create app list for OsReceiveScreen
Ldoppea Oct 11, 2023
337a6d3
fix: generate web link for routetoupload
acezard Oct 12, 2023
322831c
fix: handle ui changes during lifecycle
acezard Oct 13, 2023
f8dbea6
refactor: make base64 values silenced in logs
acezard Oct 13, 2023
859367d
fix: get icon from iconTable faster
acezard Oct 14, 2023
e1bd449
fix: reduce flickering at first render cycle
acezard Oct 14, 2023
dd95046
fix: call setFlagshipUi more often
acezard Oct 16, 2023
a0b9b14
refactor: improve logging and cancelupload
acezard Oct 17, 2023
9ee8142
feat: Update translations for OsReceive's app list
Ldoppea Oct 17, 2023
677770e
fix: remove previously deleted files
acezard Oct 18, 2023
9a0cfea
fix: remove share extension popup
acezard Oct 18, 2023
0ad0dc7
fix: trigger statusbar change more often
acezard Oct 18, 2023
5278d76
refactor: rename uploadFiles to uploadFile
acezard Oct 20, 2023
30dacaa
feat: Handle OsReceive in white labels
Ldoppea Oct 11, 2023
21bc1f9
feat: Adapt prod CI to handle new iOS Share extension
Ldoppea Oct 17, 2023
372b51f
feat: Adapt dev CI to handle new iOS Share extension and support ad-hoc
Ldoppea Oct 17, 2023
c152f80
feat: Export XCode build logs when the CI fails
Ldoppea Oct 16, 2023
7463814
fix: Handle latest changes for palette files in white labels
Ldoppea Oct 17, 2023
e6e270a
feat: handle uploadFiles as array
acezard Oct 21, 2023
ce1e103
refactor: remove dead files/rename logs
acezard Oct 23, 2023
4ca9697
fix: do not handle files if user is unlogged
acezard Oct 24, 2023
6cfbb0a
fix: fix CI
acezard Oct 24, 2023
169bff4
fix: Do not back to home if it's not needed
acezard Oct 24, 2023
1d3467e
feat: go back to previous cozyapp if possible
acezard Oct 24, 2023
5e0c479
fix: adjust icon height in <List />
acezard Oct 24, 2023
38c0751
feat: add a fromFlagship tag in file data
acezard Oct 25, 2023
7f08fa6
fix: reset UIstate less agressively
acezard Oct 25, 2023
7cb6866
refactor: handle FileReceiver init once
acezard Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/build-ios-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,34 @@ jobs:
run: cd ios && pod install --repo-update && cd ..

- name: Build IOS App
id: ios_build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
uses: yukiarrr/[email protected]
with:
project-path: ios/CozyReactNative.xcodeproj
p12-base64: ${{ secrets.IOS_P12_BASE64 }}
mobileprovision-base64: ${{ secrets[format('{0}_IOS_MOBILE_PROVISION_BASE64', inputs.brand)] }}
export-options: ios/options-dev.plist
mobileprovision-base64: |
${{ secrets[format('{0}_IOS_MOBILE_PROVISION_HADOC_BASE64', inputs.brand)] }}
${{ secrets[format('{0}_SHARE_IOS_MOBILE_PROVISION_HADOC_BASE64', inputs.brand)] }}
code-signing-identity: 'iPhone Distribution'
team-id: ${{ secrets.IOS_TEAM_ID }}
certificate-password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
workspace-path: ios/CozyReactNative.xcworkspace
scheme: CozyReactNative
export-method: ad-hoc

- name: Upload artifact to GitHub
uses: actions/upload-artifact@v3
with:
name: iOS App Store Package
path: 'output.ipa'

- name: Upload XCode error logs
uses: actions/upload-artifact@v3
if: always() && steps.ios_build.outcome == 'failure'
with:
name: XCode Build Logs
path: '/Users/runner/Library/Logs/gym/CozyReactNative-CozyReactNative.log'

20 changes: 12 additions & 8 deletions .github/workflows/build-ios-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,34 @@ jobs:
run: cd ios && pod install --repo-update && cd ..

- name: Build IOS App
id: ios_build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
uses: yukiarrr/[email protected]
with:
project-path: ios/CozyReactNative.xcodeproj
p12-base64: ${{ secrets.IOS_P12_BASE64 }}
mobileprovision-base64: ${{ secrets[format('{0}_IOS_MOBILE_PROVISION_BASE64', inputs.brand)] }}
export-options: ios/options-prod.plist
mobileprovision-base64: |
${{ secrets[format('{0}_IOS_MOBILE_PROVISION_BASE64', inputs.brand)] }}
${{ secrets[format('{0}_SHARE_IOS_MOBILE_PROVISION_BASE64', inputs.brand)] }}
code-signing-identity: 'iPhone Distribution'
team-id: ${{ secrets.IOS_TEAM_ID }}
certificate-password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
workspace-path: ios/CozyReactNative.xcworkspace
scheme: CozyReactNative

- name: Upload CozyReactNative-CozyReactNative.log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: CozyReactNative-CozyReactNative.log
path: /Users/runner/Library/Logs/gym/CozyReactNative-CozyReactNative.log

- name: 'Upload app to TestFlight'
uses: apple-actions/upload-testflight-build@v1
with:
app-path: 'output.ipa'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}

- name: Upload XCode error logs
uses: actions/upload-artifact@v3
if: always() && steps.ios_build.outcome == 'failure'
with:
name: XCode Build Logs
path: '/Users/runner/Library/Logs/gym/CozyReactNative-CozyReactNative.log'
10 changes: 10 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@
<data android:host="${universalLinkUrl}" />
<data android:pathPrefix="/flagship" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity-alias>

<activity-alias
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package io.cozy.flagship.mobile;

import android.os.Bundle;
import android.content.Intent;

import com.facebook.react.ReactActivity;
import com.zoontek.rnbootsplash.RNBootSplash;
import com.rnimmersivebars.ImmersiveBars;

public class MainActivity extends ReactActivity {

// Static variable to track if the app was opened via a sharing intent
public static boolean wasOpenedViaSharing = false;

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
Expand All @@ -24,4 +28,21 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
RNBootSplash.init(R.drawable.bootsplash, MainActivity.this);
}

@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}

@Override
protected void onResume() {
super.onResume();
}

@Override
protected void onPause() {
super.onPause();
MainActivity.wasOpenedViaSharing = false;
}
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
googlePlayServicesLocationVersion = "20.0.0"
DocumentScanner_compileSdkVersion = 33
DocumentScanner_targetSdkVersion = 33
kotlinVersion="1.6.0"
kotlinVersion = '1.6.10' // react-native-receive-sharing-intent requires a global kotlin version else the build fails
}
repositories {
google()
Expand Down
Loading