The best way to get a Share Extension engaged on Maui iOS

0
1
The best way to get a Share Extension engaged on Maui iOS


For the previous few months I have been porting my app from Xamarin to Maui for iOS on Mac. It has been extremely troublesome, largely as a result of instruments failing or not working as marketed.

Proper now I feel I am on the house straight however I am dealing with what appears to be the hardest drawback of all.

My app has a Shared Extension that works in debug mode, however not in launch mode. When working in launch mode (which takes round 20-30 min to compile), after I click on on the my app’s icon within the shared apps panel, the panel goes gray momentarily earlier than returning to its regular color, however the view that I’ve created would not seem.

I am unsure the place to go along with this.

  • Breakpoints will not work as a result of it isn’t debug and even in debug mode they do not work in extensions
  • I’ve double checked provisioning and it is all right (precisely the identical as what I used to be utilizing for Xamarin)
  • I’ve checked my entitlements, share teams and bundle names, all are right
  • I’ve tried setting debug remarks to the clipboard, however SharedExtensions do not assist clipboard entry

Provided that it really works in debug and works in manufacturing in Xamarin, I am assuming it is a configuration drawback fairly than a code drawback. As such the next recordsdata could also be accountable (?):

Right here is the Major app csproj:



    
        
        net9.0-ios 
   
        Exe
        MyApp
        true
        true
        allow
        allow

        
        MyApp

        
        com.MyApp.MyApp

        
        1.0
        1

        12.2
        13.1
        21.0
        10.0.17763.0
        10.0.17763.0
        6.5
        
        
    

    
        
            true
            false
        
    

    ...
    ...
    ...
    ...
    ...


Right here is the ShareExtension csproj:


  
    net9.0-ios
    Library
    com.MyCompany.MyApp.ShareExtension
    allow
    true
    13.0

        true
    
    full
  

  
      true
      false
  

  
    Apple Improvement: Created by way of API (XXXXXXXXXX)
    VS: com.MyCompany.MyApp.ShareExtension Improvement
  


Right here is the Major app information.plist:





    UIDeviceFamily
    
        1
        2
    
    UISupportedInterfaceOrientations
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    UISupportedInterfaceOrientations~ipad
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationPortraitUpsideDown
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    MinimumOSVersion
    12.2
    CFBundleDisplayName
    MyApp
    CFBundleIdentifier
    com.MyCompany.MyApp
    CFBundleName
    MyApp
    XSAppIconAssets
    Belongings.xcassets/appicon.appiconset
    UILaunchStoryboardName
    LaunchScreen
    UIViewControllerBasedStatusBarAppearance
    
    NSExtensionPointIdentifier
    com.apple.share-services
    CFBundleURLTypes
    
        
            CFBundleURLName
            com.MyCompany.MyApp
            CFBundleURLSchemes
            
                shareto
            
            CFBundleTypeRole
            None
        
    
    NSAppleMusicUsageDescription
    Choose audio file for sheet
    NSMicrophoneUsageDescription
    Report audio loop
    UIBackgroundModes
    
        audio
    
    CFBundleShortVersionString
    1.0.001
    CFBundleVersion
    1
    ITSAppUsesNonExemptEncryption
    
    UIFileSharingEnabled
    


Right here is the Share Extension information.plist:




    
        CFBundleDevelopmentRegion
        en
        CFBundleDisplayName
        MyApp
        CFBundleIdentifier
        com.MyCompany.MyApp.ShareExtension
        CFBundleInfoDictionaryVersion
        6.0
        CFBundleName
        com.MyCompany.MyApp.ShareExtension
        CFBundlePackageType
        XPC!
        CFBundleSignature
        ????
        MinimumOSVersion
        13.0
        NSExtension
        
            NSExtensionAttributes
            
                NSExtensionActivationRule
                
                    NSExtensionActivationSupportsFileWithMaxCount
                    1
                    NSExtensionActivationSupportsImageWithMaxCount
                    1
                    NSExtensionActivationSupportsMovieWithMaxCount
                    0
                    NSExtensionActivationSupportsText
                    
                    NSExtensionActivationSupportsWebURLWithMaxCount
                    1
                
            
            NSExtensionPrincipalClass
            CodeBasedViewController
            NSExtensionPointIdentifier
            com.apple.share-services
        
        CFBundleURLTypes
        
            
                CFBundleURLName
                URL Kind 1
                CFBundleTypeRole
                Editor
            
        
        CFBundleShortVersionString
        1.0.001
        ITSAppUsesNonExemptEncryption
        
        CFBundleVersion
        001
    

What can I do to debug this? It is an extremely troublesome drawback to resolve, particularly given the 20-30 min compile occasions which suggests I can solely check out 2 or 3 completely different trouble-shooting makes an attempt per hour, making it exhausting to make significant progress.

Any concepts could be a lot appreciated.

LEAVE A REPLY

Please enter your comment!
Please enter your name here