-
Notifications
You must be signed in to change notification settings - Fork 406
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
base: master
Are you sure you want to change the base?
Conversation
@KasemJaffer Please fix this bug dude |
android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt
Outdated
Show resolved
Hide resolved
android/src/main/kotlin/com/kasem/receive_sharing_intent/ReceiveSharingIntentPlugin.kt
Outdated
Show resolved
Hide resolved
@@ -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... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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:
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...
@KasemJaffer |
@KasemJaffer |
Copy of @LazyDave76's pull request #137
Close #144