nativescript-nodeify
nativescript-nodeify copied to clipboard
AWS AppSync Support
For a {N} app I'm working on, I was hoping to be able to add support for Amazon's new service AppSync through their app-sync npm module: https://github.com/awslabs/aws-mobile-appsync-sdk-js
I know nativescript-nodeify works for other amazon libraries including cognito, so I tried to use it to convert the appsync module to something I could use in {N} but I'm getting an error:
JavaScript error: file:///app/tns_modules/setimmediate/setImmediate.js:175:64: JS ERROR TypeError: doc.createElement is not a function. (In 'doc.createElement("script")', 'doc.createElement' is undefined)
Here's my code:
import { Component, OnInit } from "@angular/core"; require("nativescript-nodeify"); const AWSAppSyncClient = require('aws-appsync').default;
@Component({
selector: "my-app",
template: <ActionBar title="My App" class="action-bar"></ActionBar> <!-- Your UI components go here -->
})
export class AppComponent implements OnInit {
// Your TypeScript logic goes here
ngOnInit() { console.log("onInit");
} }
i thought AppSync was still in beta-preview?
Please note, your participation in this preview is subject to Section 1.10 of the AWS Service Terms (Beta Service Participation). If you do not agree to those terms, you will not be able to participate in the preview. In particular, please note that your participation in this preview is confidential, and you agree that you will not disclose any of your findings or observations about the preview to any individuals or organizations not authorized by Amazon Web Services.
Not anymore in preview (it was an helpful comment anyway), I've just checked it out and it looks like Nativescript support would be cool to have, @fhackenb did you make it work?
Nope, I ended up going with https://github.com/couchbaselabs/nativescript-couchbase and using a sync-gateway for syncing across devices.
Anyone has working solution?