microsoftconnect/ms-intune-app-sdk-ios

Some API of AppDelegate in not called in SwiftUI project After adding intune frameworks

Jason-wonku-Ji opened this issue · 7 comments

Hello,

I'm building an app with SwiftUI.
And we want to apply intune functionality to our app.
We downloaded the intune SDK from git and added it to the project.

IntuneMAMSwift.xcframework
IntuneMAMSwiftStub.xcframework

However, even though I just only added the above two frameworks to the project, some functions of AppDelegate are not being called.

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return AppDelegate.orientationLock
}

We need to lock the screen vertically in some views.
So in that view I change orientationLock to .portrait and when that view is closed I change it back to .all.

And if you do not add the above two frameworks to the project, the above API will be called normally and the direction will be fixed/released as desired.

I thought it was a problem with the project settings, so I created a basic sample project and tested it.
IntuneMAMSwift.xcframework
IntuneMAMSwiftStub.xcframework
We confirmed that supportedInterfaceOrientationsFor window is not called by simply adding these two frameworks to the project.
Maybe you can check it out too.

However, in regular Swift projects other than SwiftUI, the API is called normally even if Intune frameworks are added.

The problem appears to only occur in SwiftUI.

Could you please confirm this?

For reference, I tested it with the latest version of intuen SDK and it was the same.

Hi could you share the basic sample project, and also the steps to reproduce the issue, I can then test it.

@wangxiaoms

Hello Wang,

I attached two sample projects.
Below two intune frameworks also included in that projects.

IntuneMAMSwift.xcframework
IntuneMAMSwiftStub.xcframework

If you add these frameworks to SwiftUI project and run project, below API is not called.

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window:

But if you just remove these frameworks, this API is called.

And this behaviour is not reproduced in Swift project.

Hi @Jason-wonku-Ji I'm checking this with the team, will let you know once there is an update.

@wangxiaoms
Hello wangxiaoms
Can I get any update?

@Jason-wonku-Ji the team is looking into it, I will let you know once there is an update.

Hi @Jason-wonku-Ji our team has looked into it, there will be a fix but currently we don’t have a release date yet. There is a work around you may consider, I have sent you some code suggestions via email.