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

Fix Kotlin build problem #145

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

proninyaroslav
Copy link

Copy of @LazyDave76's pull request #137
Close #144

@sbswami
Copy link

sbswami commented Mar 12, 2021

@KasemJaffer Please fix this bug dude

@@ -149,7 +149,8 @@ public class SwiftReceiveSharingIntentPlugin: NSObject, FlutterPlugin, FlutterSt
guard let path = getAbsolutePath(for: $0.path) else {
return nil
}
return SharedMediaFile.init(path: $0.path, thumbnail: nil, duration: nil, type: $0.type)
let pathWithoutPrefix = String($0.path.dropFirst(7))//knock 'file://' off here...
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch is taken from here #141. @LazyDave76 is the author of both patches.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared media object has a path property which already contains "file://" on iOS.

This results in file not found when looking up the path in iOS because the value looks like "file://file://PathToCopiedFile"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having 'fixed' this bug in a pretty hacky way - this is probably what it should look like:

Suggested change
let pathWithoutPrefix = String($0.path.dropFirst(7))//knock 'file://' off here...
return SharedMediaFile.init(path: path, thumbnail: nil, duration: nil, type: $0.type)

seems that the path is url encoded though and there are fun times with files with spaces...

@proninyaroslav
Copy link
Author

@KasemJaffer
Please merge this PR

@LazyDave76
Copy link

@KasemJaffer
Please merge this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kotlin build problem
5 participants