I am trying to implement share extension to my xamarin forms app. And I followed these:
And git repo above works when I run it. But I need to implement this for my xamarin forms project.
So I did this steps:
1) I right clicked to my xamarin forms solution. After I select add, new project. And I created "Share Extension (iOS)" project. (I choosed .Net Framework 4.7.2)
2) A Share extension project is created with ShareViewController. I didn't do any change this.
3) I opened info.plist of new created ShareExtension project. And I paid attention bundle identifier. For example my xamarin project's bundle identifier is "com.xamarin.test" and my share extension project's bundle identifier is "com.xamarin.test.share-extension"
4) I selected MinimumOSVersion 10.0 of my main project and my share extension.
5) In my project,NSExtension is following:
> <key>NSExtension</key> > <dict> > <key>NSExtensionAttributes</key> > <dict> > <key>NSExtensionActivationRule</key> > <dict> > <key>NSExtensionActivationSupportsFileWithMaxCount</key> > <integer>1</integer> > <key>NSExtensionActivationSupportsImageWithMaxCount</key> > <integer>1</integer> > <key>NSExtensionActivationSupportsMovieWithMaxCount</key> > <integer>1</integer> > <key>NSExtensionActivationSupportsText</key> > <false/> > <key>NSExtensionActivationSupportsWebURLWithMaxCount</key> > <integer>1</integer> > </dict> > </dict> > <key>NSExtensionMainStoryboard</key> > <string>MainInterface</string> > <key>NSExtensionPointIdentifier</key> > <string>com.apple.share-services</string> > </dict> >
6) After I cleaned whole solution and rebuilded, I added to reference shared extension project's dll to my xamarin ios project. After that I run the project. (on iphone 7 ios 12.0 simulator)
When I open photos and I click share for a photo, I expect to see my app on share menu. But it doesn't work. I guess I missed a step but what is this, I don't know. Somebody help me please.