Share ANE don't verify the key - share

I'm developing an App for iOS and Android and for this app I'm using different ANEs from distriqt (PushNotifications and Share). PushNotifications ANE key validation works fine, but on Share ANE I get the following error with the same key:
Your key was not able to be verified for the com.distriqt.Share native extension
Also I remove the line that check is Share is supported
if (Share.isSupported) {
...
}
because it generates another error:
Error #3500: The extension context does not have a method with the name isSupported.

Make sure that you have generated a key that includes the Share extension. Keys don't automatically work for all extensions, you will need to regenerate (update) it if you add new extensions.
Check the applications page in your account.
Please note you should ask questions like this in our support forums on github.

Related

Receive share file intents with Flutter with IOS

I'm using the following plugin
https://pub.dev/packages/receive_sharing_intent
It is working with android.
But the instruction for IOS are unclear - I follow the IOS instruction and I'm able to share files with my app, when I do so, my app opens but the flutter code is not executed, the only thing I see in the log is:
6.26.0 - [Firebase/Analytics][I-ACS023000] Deep Link Web URL query is empty
Which doesn't mean any thing to me.
I tried to look for this error and couldn't find anything that is related to sharing intent.
Can someone clarify this?
Is there a tutorial on how to set sharing intent for IOS?
In the instruction it says:
ios/Runner/Runner.entitlements
....
<!--TODO: Add this tag, if you want support opening urls into your app-->
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:example.com</string>
</array>
But I don't have such file in my directory structure, any idea how to set it correctly?
....
EDIT:
I created and added the file ios/Runner/Runner.entitlements manually
I noticed I missed the last step (after publishing the question), so I did it:
Add Runner and Share Extension in the same group
Go to the Capabilities tab and switch on the App Groups switch for both targets. Add a new group and name it group.YOUR_HOST_APP_BUNDLE_IDENTIFIER in my case group.com.kasem.sharing
This step is not very clear:
the name of the tab is Signing & Capabilities
in order to switch on the App Group you should click on `+ Capability' in the top left of the tab
I checked the checkbox next to App Group
Add a new group and name it group.YOUR_HOST_APP_BUNDLE_IDENTIFIER in my case group.com.kasem.sharing
After this I was able to receive the file intent in the App but couldn't open the file:
print("$path, exist ${await io.File(path).exists()}");
I was able to print the path but the exists method return false
NOTE:
works with no issues in android
works with no issues in IOS when sharing an image
only fails with files (PDF)

Google Play Games Service in Unity doesn't authenticate

GPG service does not work
It shows the native GPG window, but when it’s closed the PlayGamesPlatform.Instance.Authenticate() callback returns NetworkError
In the Google Play Console:
Created "Game service”.
In the “Game details” section, added a description 512x512 and 1024x500 icons.
In the “Linked apps” section, added an android application and completed authentication (OAuth 2.0 key was automatically created)
In the “Achievements” section, created an achievement with a description and a 512x512 icon.
In the "Testing" section added a gmail account for testing
In the “Publishing” section, clicked Publish.
In the Google API:
Activated Google Drive API and Google Play Android developer API (without creating any keys)
Checked the SHA-1 in the OAuth key for Android and in “Release management”> ”App singing”> ”App signing certificate”
In Unity:
Downloaded the latest release from https://github.com/playgameservices/play-games-plugin-for-unity
In Window> Google Play games> Setup> Android setup, copied the xml format text from the “Achievements” section of the Google Play Console using the “Get resources” link, the ClientID format is 123456789123456-fffffffffffffffffffffffff.apps.googleusercontent.com
The test build was signed with the same key as the application posted on Google Play with the same Company name and Product Name
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequestIdToken()
.Build();
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptAlways, ((SignInStatus status) =>
{
if (status == SignInStatus.Success)
{
print( $"Welcome {PlayGamesPlatform.Instance.GetUserDisplayName()}\n");
}
else
{
print($"Fail:{status}");
}
}));
On debugging in Unty Console I have
<i>AndroidPlayer(ADB#127.0.0.1:34999)</i> Returning an error code.
#0 0x443df5a (libunity.so) GetStacktrace(int) 0x25
#1 0x4e788b6 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x169
#2 0x49875fe (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
#3 0x498754e (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
I just saw this. I had the same error. What I did to fix it was I toned down the bytecode stripping in the project settings. When I checked the unity developer console, I noticed the error stating that my game couldn't find the library for GooglePlayGames.
While this is not the IDEAL answer, it's a temporary fix. The Ideal answer is creating a Link.xml file that tells the compiler not to strip out library .so file.
(Which, I am searching for at the moment, and how I came across your question.)
I came across this post while trying to find the answer myself and now that I know the answer I thought I would add it in here.... so that I can no doubt discover it the next time I forget how to do this. The issue is caused by the minification as #CherryCoke stated.
The solution can be found here: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/README.md#decreasing-apk-size
You have two options: either turn off the minification or tell the minify process what to ignore when doing the minification.
If you want to minify your build (which makes sense to me for a release) then you can do so by selecting "Custom Proguard File" in the Publishing Settings area of the Android build in the Player Settings.
Once you have added this in you will need to update the proguard-user.txt file that is specified. The path is displayed under "Custom proguard File".
For google play services then the entries you need to add can be found at: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/scripts/proguard.txt

AWS Amplify iOS SDK problem after adding REST API to Swift project

I'm having a problem after adding the AWS Amplify iOS SDK REST API to my project. I am unable to build my project due to 3 fatal compiler errors in one Amplify added file (*Client.swift under the generated-src folder), and I don't know what to do about them.
Everything was going very well with my iOS app after leveraging the Drop-in UI for authentication: I was able to sign in via my pre-existing Amazon Cognito User Pool. So, things were working.
Next step, I wanted to access a pre-existing DynamoDB table. It seems that the way to do this in an Amplify context is to add the REST API.
Following the steps in the link above, I knew Amplify was doing something I didn't want it to do by creating its own Cognito User Pool; I guess because I specified that I wanted to "Restrict API access" to authenticated users. What I expected is that I would restrict access on the basis of my already existing Cognito User Pool, not a new one.
Anyway, that is not my immediate problem.
After issuing the pod install --repo-update command, I added the new generated-src folder to my project. I thought it was curious that my awsconfiguration.json had not changed. At that point, as instructed, I attempted to build the project but was unable to do so due to those 3 errors.
/Users/xxxxx/Dev/iOS/xxxxxxxxxx/generated-src/xxxxxxxxxxxClient.swift:148:34:
Cannot assign to property: 'endpoint' is a get-only property
/Users/xxxxx/Dev/iOS/xxxxxxxxxx/generated-src/xxxxxxxxxxxClient.swift:174:13:
Value of type 'xxxxxxxxxxxClient' has no member 'invokeHTTPRequest'
/Users/xxxxx/Dev/iOS/xxxxxxxxxxx/generated-src/xxxxxxxxxxxClient.swift:195:13:
Value of type 'xxxxxxxxxxxClient' has no member 'invokeHTTPRequest'
I cannot advance to the next step (thinking it might be the reason for those errors) because the Build Settings tab for my project doesn't show an Objective-C Bridging Header category. (Yes, I presume? Until built?)
Can someone help me out?
The good developers over at AWS Amplify's iOS SDK Github repo answered my question. As a result, they are updating the REST API guide to reflect the proper order of steps.
To summarize: you must add the Objective-C bridging header path to the Build Settings for the project. It was not obvious to me where to find this setting, but they posted a screenshot showing how to find it. Filtering without choosing those explicit settings did not turn it up in my case.

Create an App within an App

I am being presented with a very interesting project. The task that I must complete is to figure out a way to allow a partner to be involved in an app without giving up their source code. The code will be included in the main bundle of the app so it is not dynamically stored. The partner has a fully functional app that is needed to be ran in a window within the main app at the appropriate time. I know having the partners create a web app would be ideal so it is treated like a webpage but I am more concerned with codes that must be written natively in iOS.
My question is what is the best way to go about solving this? In theory it is like an App within an App. Is there a way if they gave up their .app file I can include this in the bundle and then run it when I catch a certain event? Should I have the partners create their code in a framework and then import into the shell project? What is the best way to approach this problem?
If your 2nd-party doesn't want to provide you with the source code, why doesn't he compile it to object code then let you simply link it to your app?
By the way, at least on official (non-jailbroken) iDevices, apps can't 'embed' or 'open' one another in such a way - you can open an app programmatically if 1. it's a separate app 2. it has a registered special URL associated to its bundle.
Is there a way if they gave up their .app file I can include this in
the bundle and then run it when I catch a certain event?
No, you'll want to have them create a library instead. You can then include that library in your project.
Creating a library is as simple as:
Choose File->New...->Project... in Xcode.
Select the "Cocoa Touch Static Library" project template.
Add your code.
Build.
The result is a static library that you can add to your application(s). The library will contain the compiled code that you added, but doesn't include the source code. The library developer should provide whatever header files are necessary to use the code in the library.
An App within an App is possible however it requires a common data framework that allows one app to reference the same data without confusing the the source of and destination of the data.
Such a framework allows one app to interact with another app referencing the same data.

How to share keychain data between iOS applications

I am describing a problem for which it took me quite some time to learn the answer.
The "GenericKeychain" example is a good start at providing a wrapper for sharing keychain data between applications when using the accessGroup in the init.
However, implementing this in my app yielded an obscure error code (which took forever to locate) -25243, which means: No access control.
I ran Apple's example app (GenericKeychain) on my iPad only to get the same error. Huh?
Does Apple's documentation fail to deliver on what is necessary to accomplish this?
After some (a lot of) digging throughout the web, I found the answer. The access Group that you use when constructing your KeychainItemWrapper class must ALSO be specified in each of your application's Entitlements.plist file in the "keychain-access-groups" section.
It seems almost obvious now that I see "keychain-access-groups". However, I had no idea to even look there. Hope this helps others.
Actually it's not hard to do. Please follow the steps.
App1:
Open your App's target Capabilities and enable KeyChain Sharing.
Add a identifier. (eg : com.example.sharedaccess)
Add "UICKeyChainStore" to your project.
Be sure you have a team id added to your App1 project.
Add Security.framework to your App1 project.
And add these codes to somewhere you need.
[UICKeyChainStore setString:#"someValue" forKey:#"someKey" service:#"someService"];
App2:
Open your App's target Capabilities and enable KeyChain Sharing.
Add a identifier. (eg : com.example.sharedaccess)
Add "UICKeyChainStore" to your project.
Be sure you have a team id added to your App2 project.
Add Security.framework to your App2 project.
And add these codes to somewhere you need.
NSString *string = [UICKeyChainStore stringForKey:#"someKey" service:#"someService"];
Your TeamIDs should be same for both projects.
I tried these steps on a real iPhone device.
I also tried these steps with Automatic and iOs Development provisioning profile.
My apps' bundle identifiers were like that : com.example.app1, com.example.app2.