I'm afraid you can't do that, Steeve.
If you could, then it wouldn't be a very secure certificate, would it?!
It's down to you, to "Keep it secret. Keep it safe."
More information is needed:
Can we see the definition of self.player?
And the code of the enclosing View?
And the View that ".onAppear" is attached to?
I'm glad I could help, @Euler1200.
Just for reference, when you mark a forum answer as correct, you mark the correct answer, not your response to it!
(This keeps the forum working smoothly, and is also a thank-you to the forum user who took time out to help you.)
Hi again Steeve,
"com.baobabeducation" does not look like a valid Bundle ID.
It looks like a Bundle ID prefix, which would normally be followed by the app-name, something like:
com.baobabeducation.MathVenture // or whatever...
(By the way, from your previous question, when you mark a forum answer as correct, you mark the correct answer, not your response to it!)
Using an online JSON validator, your example threw up several errors.
So it looks like your json syntax is indeed invalid, as your error message says.
Try:
"38": "images/toolbar-icon-38.png",
Remove trailing comma (line 23)
"*://www.linkedin.com/*",
Remove trailing comma (line 62)
"https://api.mixpanel.com/*",
Remove trailing comma (line 82)
Other JSON parsers might be more forgiving, but I would suggest fixing those issues, then trying again.
This question has been asked many times.
It is not possible to prevent screenshots and screen recording on iOS.
And yet, ScreenShieldKit seems to have achieved this!
That suggests, at the least, that it is very difficult, and there is no "simple" coding solution.
I suggest that you investigate ScreenShieldKit, and see if their pricing model suits your needs (depending on how important this feature is, for your app).
As @OOPer says, a CXProviderDelegate must be an NSObject, so it can't be a SwiftUI View.
It would have to be a class, perhaps as (part of) your Model or ViewModel (assuming that you are using MVVM).
Remember that SwiftUI is only providing the user interface for your app.
SwiftUI is not doing all the behind-the-scenes processing!
http is still allowed (for now?), but you have to jump through some hoops with your Info.plist keys:
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSExceptionDomains
NSThirdPartyExceptionAllowsInsecureHTTPLoads
Have you got all of those?
Yes.
iOS will kill off backgrounded apps, based on various factors (which are hard to predict).
You could expect this to happen more agressivily in low power mode.
I'm afraid you can't do that, Steeve.
If you could, then it wouldn't be a very secure certificate, would it?!
It's down to you, to "Keep it secret. Keep it safe."
More information is needed:
Can we see the definition of self.player?
And the code of the enclosing View?
And the View that ".onAppear" is attached to?
I'm glad I could help, @Euler1200.
Just for reference, when you mark a forum answer as correct, you mark the correct answer, not your response to it!
(This keeps the forum working smoothly, and is also a thank-you to the forum user who took time out to help you.)
Hi again Steeve,
"com.baobabeducation" does not look like a valid Bundle ID.
It looks like a Bundle ID prefix, which would normally be followed by the app-name, something like:
com.baobabeducation.MathVenture // or whatever...
(By the way, from your previous question, when you mark a forum answer as correct, you mark the correct answer, not your response to it!)
Using an online JSON validator, your example threw up several errors.
So it looks like your json syntax is indeed invalid, as your error message says.
Try:
"38": "images/toolbar-icon-38.png",
Remove trailing comma (line 23)
"*://www.linkedin.com/*",
Remove trailing comma (line 62)
"https://api.mixpanel.com/*",
Remove trailing comma (line 82)
Other JSON parsers might be more forgiving, but I would suggest fixing those issues, then trying again.
This question has been asked many times.
It is not possible to prevent screenshots and screen recording on iOS.
And yet, ScreenShieldKit seems to have achieved this!
That suggests, at the least, that it is very difficult, and there is no "simple" coding solution.
I suggest that you investigate ScreenShieldKit, and see if their pricing model suits your needs (depending on how important this feature is, for your app).
As @OOPer says, a CXProviderDelegate must be an NSObject, so it can't be a SwiftUI View.
It would have to be a class, perhaps as (part of) your Model or ViewModel (assuming that you are using MVVM).
Remember that SwiftUI is only providing the user interface for your app.
SwiftUI is not doing all the behind-the-scenes processing!
http is still allowed (for now?), but you have to jump through some hoops with your Info.plist keys:
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSExceptionDomains
NSThirdPartyExceptionAllowsInsecureHTTPLoads
Have you got all of those?
Yes.
iOS will kill off backgrounded apps, based on various factors (which are hard to predict).
You could expect this to happen more agressivily in low power mode.