Comments (13)
Hello @markelarizaga , yes, you should see it in the virtual device, too. The example app should be working on iOS (SendIntentExample) and should illustrate a complete configuration. You see the SendIntentExample-option in the image scrrenshot below (Virtual Device).
from send-intent.
Please check out this thread 80 as it covers some potential problems with signing and deployment target!
from send-intent.
That made the trick! Thanks a lot for your support and quick responses.
from send-intent.
Did you walk through all the steps describe in README? You need to ceate a "Share Extension", register your URL Scheme and create an app group.
from send-intent.
I'm having a similar issue, and my first bet is I have something odd in my config. But I have a question. Should I see my app listed as a share target in the iOS simulator or does the simulator have any kind of limitation for this to work?
I don't have a real device handy so I was wondering if I should be able to operate normally with the send-intent plugin provided that I have my config properly implemented.
from send-intent.
Hi again, I installed the example app in my simulator, which simulates an iPhone 15 Pro with iOS 16.2, and when trying to share a webpage via Safari, I see this:
![Screenshot 2024-04-09 at 01 04 35](https://private-user-images.githubusercontent.com/2715429/320671605-5668193e-dd4d-4001-a83d-5707331c8fd0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MjM1NjAsIm5iZiI6MTcxOTkyMzI2MCwicGF0aCI6Ii8yNzE1NDI5LzMyMDY3MTYwNS01NjY4MTkzZS1kZDRkLTQwMDEtYTgzZC01NzA3MzMxYzhmZDAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDJUMTIyNzQwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGEwYmYzMDdlYmY0ZTVjZTNiNTU2ZDg5NDE0YmI1MWI3ZGQyNWE1ZTIwZWZiY2QwNjk4MmQ1OTEyMjM1NTJmYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.sz32BN5DJRF7n_-HMSpTTc6qVJwLo5a02-biKRu_fso)
As you see the example app is not listed for some reason. My understanding is that just checking out the example code, building it in Xcode and running it should be enough, right? I don't need to change any groups, url schemes or anything, correct?
from send-intent.
Hello @markelarizaga, might be a stupid question but did you try clicking on "... mas"? If it is really not listed, maybe signing is a problem. This is configured individually in XCode (Targets -> Signing and Capabilities).
from send-intent.
Haha, it's not a stupid question at all, but yes, I tried clicking in Más (which for context means More in Spanish) but the app is not there either.
As you say, I tend to think on something around the app config on my side. I will keep trying. Thanks a lot for your quick responses.
from send-intent.
I just realized I never answered back. I finally made it and my app appears among the share targets in iOS. It was something in the app config to be tweaked in Xcode.
However, now I am facing a different issue. When sharing, say, a website from safari, my app opens correctly but the object passed to handleIntent contains only empty values:
window.addEventListener("sendIntentReceived", () => {
SendIntent.checkSendIntentReceived()
.then(handleIntent)
.catch(handleError);
});
function handleIntent(result) {
// result is { title: "", description: "", type: "", url: "", additional-terms: "" }
}
Any clue? I gave a look to the swift code in the documentation and the closest thing I see that could generate such an object is this:
let queryItems = shareItems.map {
[
URLQueryItem(
name: "title",
value: $0.title?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""),
URLQueryItem(name: "description", value: ""),
URLQueryItem(
name: "type",
value: $0.type?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""),
URLQueryItem(
name: "url",
value: $0.url?.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? ""),
]
}.flatMap({ $0 })
Unfortunately I never worked with Swift so everything I can make are guesses. Let me know if you prefer to open a new issue @carsten-klaffke .
from send-intent.
It's hard to tell what is going wrong from here. You could debug or log some code positions to see where the info is getting lost. For this, I would suggest:
- ShareViewController::sendData(), check queryItems (just as you already pointed out yourself)
- AppDelegate::application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) , check if params are arriving properly
- SendIntent::checkSendIntentReceived(), check if "firstItem" in store holds the correct values
from send-intent.
Will do!
Thanks again for the help.
from send-intent.
Ok, I tried debugging the share action.
I see sendData function gets values that make sense (I'm sharing a webpage from Safari):
However, the app doesn't seem to stop in the app delegate.
I'm seeing this in Xcode when I set a line to debug:
And it says something like: Xcode won't stop in this line because it has not been resolved
. Can it be there is something in my config that is making the app not run that code?
I also spotted a difference between my code and the docs/examples in this repo. In AppDelegate, this line:
let store = ShareStore.store
Was causing a compilation error: "Cannot find 'ShareStore' in scope"
.
I overcome the build error this causes by adding the following code into the file:
public final class ShareStore {
public static let store = ShareStore()
private init() {
self.shareItems = []
self.processed = false
}
public var shareItems: [JSObject]
public var processed: Bool
}
Honestly I don't know how I reached this code, but it makes the build error disapear and run the app. Can this be related to my problem?
from send-intent.
I would assume that the new definition of ShareStore is causing the problem. You are writing to the wrong object, so the plugin can't read the data. Your AppDelegate::application(...
)-call should be fine, as the "sendIntentReceived"-event is fired and catched properly in your JS-Code. So don't worry about the breakpoint that doesn't cause a stop (probably a non-debuggable line)! To get rid of the error "Cannot find 'ShareStore' in scope"
, try refreshing, cleaning and rebuilding your project/pods! It should be found.
from send-intent.
Related Issues (20)
- App crash after SendIntent.finish() HOT 14
- Multi Files HOT 1
- Android app reload when sharing HOT 1
- IOS ,Universal link
- multiple file when app working on background not get catch HOT 4
- Changelog? What changed in v3? HOT 2
- Sharing multiple files from WhatsApp on iOS HOT 11
- Android: Class referenced in the manifest, SendIntentActivity, was not found HOT 3
- Compatibility with Capacitor 5 HOT 3
- Video upload not working android HOT 1
- ShareViewController transfers too many '/' in file url HOT 2
- [solved] Manual signing HOT 3
- Named export not found. The request module is a CommonJS module
- [Android] Receive multiple intent data until app hangs and App Crash after calling finish HOT 2
- Invalid Info.plist value for NSExtensionActivationRule HOT 4
- My Capacitor app does not show up in the "Open With" list of GMAIL HOT 1
- App crashes upon changing device orientation HOT 2
- View intent on Android HOT 1
- App crashes when switching between Sliding Tabs by clicking the tabs (not swiping) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from send-intent.