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

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.

Related

qlik sense error in published dashboard that does not appear in edit mode

I built a dashboard in Qlik Sense and after I published it I noticed the following error -
"Invalid sort order in properties".
When I duplicate the dashboard in order to edit it, the error drops and the data is shown correctly.
What could be the issue?
Had similar issue some time back. In my case the object was an extension and it was trying to modify (apply some patches) to the underlying object. As in your case it was working fine if the app is not published. The reason was that once the app is published you don't have the permission to modify objects that are published.
Modify objects on published apps is forbidden by default. It can be overwritten by changing one of the default security rules but personally I will not advise you to change the security rule because it will be applied to all published apps (unless you change the security rule to target only set of apps)

VSTS Extension - Release definition data, environment ids

I am developing web extension for VSTS. I am using vss sdk of Microsoft.
I got some issue.
You can see on the image that there is new line - App insights Settings
This pop up appears on clicking on 3 dots near every release definition on page of list of all releases.
This button navigates user to some environment of some specific release.
Example of link:
https://ozcodedev.visualstudio.com/OzCode/_releaseProgress?releaseId=372&_a=release-environment-logs&environmentId=850
The problem that I do not know how to fetch list of releases and environments for building this link.
How can I get them on page All release pipelines.
Through the GUI it is not possible to get all the release ids and the environment ids for each step. However this is possible through the VSTS APIS. You could use the release endpoint to and iterate to obtain your release id
https://{accountName}.vsrm.visualstudio.com/{project}/_apis/release/releases?api-version=4.1-preview.6
Once you have the release id you can use it like so
https://{accountName}.vsrm.visualstudio.com/{project}/_apis/release/releases/{releaseId}?api-version=4.1-preview.6
Within the returned JSON you can follow iterate the path environment[n].id to obtain the environment id.
You can then construct the link using this information.
Hope that helps
Ok. So after working 2 days on this issue I found solution.
1.It is possible to fetch data that I wanted on Client Side. For this I used Microsoft's library vss-web-extension-sdk. Install it - npm install vss-web-extension-sd --save.
2.Add relevant scopes to your vss-extension.json. In my case the problem was - that I needed data that relates to managing of VSTS user releases. So after Including "vso.release_manage" to my scopes array I stopped to got 401 Unauthorized error because access token was changed according to new scopes.
https://learn.microsoft.com/en-us/vsts/extend/develop/manifest?view=vsts#scopes
In this documentation you can check which scope controls which resources that can be accessed by your extension.
You can use our ts/js clients to get whatever you want for your experience.
We have extensive documentation available here. Let me know if you are blocked anywhere.

What do you lose by ejecting a React app that was created using create-react-app?

I'm interested in using Hot Module Replacement with a newly created React app.
Facebook Incubator's create-react-app uses Webpack 2 which can be configured to support HMR, however in order to do so, one needs to "eject" the create-react-app project.
As the documentation points out, this is a "one way" operation and cannot be reversed.
If I'm to do this, I want to know what I might be giving up. I've been unable to locate any documentation that explains the potential drawbacks of ejecting.
The current configuration allows your project to get updates from create-react-app core team. Once you eject you no longer get this.
It's kind of like pulling in bootstrap css via CDN as opposed to downloading the source code and injecting it directly into your project.
If you want more control over your webpack, there are ways to configure/customize it without ejecting:
https://www.npmjs.com/package/custom-react-scripts

Invalid Argument error is shown on Google Cloud Storage files

I am using the web interface, I am trying to make public files that were uploaded and each time I click the checkbox I immediately get the error "Invalid Argument" and the box unchecks.
This also happens while trying to uncheck files already uploaded and public.
I'm not certain if something happened to my account or if this is a service problem for the site but we're in a major jame because of this. Essentially Cloud storage is unusable at this stage.
There was an issue with the web user interface and the JSON interface affecting setting ACLs on objects. That problem has been resolved, and all interfaces should be working correctly now.

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.