I'm trying to add the twilio client library and have had no luck with any of the solutions I've looked up. I have tried including the script in client/lib, client/compatibility, client/lib/compatibility, and I always get the following error:
Uncaught SyntaxError: Unexpected token <
I think it is throwing this error because it is trying to inject itself and is not able to because of the way Meteor compiles the files. Has anyone had any luck including this library? I would GREATLY appreciate any help.
There is another way to add twilio package to your project.
npm install twilio
and you can giv your SID and Token at server
var twilio = Npm.require('twilio')('ACCOUNT_SID', 'AUTH_TOKEN');
now you can make call to twilio api in server.
Hope it helps you.
The only way I could get this to work is to install the bower package, then install the meteor client library through bower.
Related
My app does not use ember-data, it uses only apollo for graphql to retrieve/manage data.
But after installing emberfire, we must have to install ember-data too.
We just use emberfire/firebase for authentication :)
If I try to remove it I've got an error:
Cannot find module 'ember-data/package.json' from '/Users/bruno/octane-graphql/node_modules/emberfire'
The solution here is simple: don't use emberfire!
Basically the entire concept of emberfire is to intergrate firebase into ember-data. If you just want to use some firebase services use the firebase sdk directly.
emberfire uses ember-data under the hood. So you need to have it installed.
I am trying to learn about any library which is good to use with Python 3.X where Script can send the SOAP/XML request to Listener/Services and Capture the response.
HttpLibrary.HTTP cant work with python 3. similar case with JASONLibrary. Any suggestions?
I used "suds" library to send SOAP requests and it worked fine.
Please give it a try. The instructions are in the below link
Python3-Suds
Also check the Robot Suds library
Robot-Suds
When using Firebase on ReactNative, it will show such error message:
can't find variable process
However, if I require firebase/lib/firebase-web.js manually, it will show:
can't find variable document
How can I resolve this?
I just went through the same issue while trying to use sockets.io in my react native app so hopefully I can help.
The reason that you cannot use firebase's node module is because there hasn't been a polyfill created yet for websockets support (which firebase is dependent on) in react native.
If you take a look at issue #619 in react native's repo you'll find the current discussion on creating a websockets api polyfill.
The way that we solved it is by using Jason's modified version of the sockets library and creating our own repo around just that file. Then we added the line below to our package.json dependencies.
"react-sockets": "crewapp/react-native-sockets-io"
The reason that Jason's version of the sockets.io client file works is because react-native is added as a user agent. You can find the code that makes this change at the top of the file:
window.navigator = {
userAgent: "react-native"
}
Once you've gone through these steps you should be able to require sockets.io / firebase as normal.
Just figuring it our. Pavan's answer is helpful, but it is not quite true when using with Firebase.
For firebase, please follow the steps:
Download the firebase-debug.js from wsExample. Or you can just install wsExample by npm and require the firebase-debug.js inside it.
Use badfortrains's forked React-Native:
"react-native": "git://github.com/badfortrains/react-native#WebSocket"
New the Firebase like this:
var firebase = require("../../firebase-debug.js");
var rootRef = new Firebase(Const.FB_ROOT);
Things should just work now!
I had issues with socket.io on React Native too, solution was to get notifications about new data and if data is big enough - get it by simple RESTfull request. in my case data was small enough to be sent all within notifications API.
I was using GCM service to send notification to phone from nodejs server. BTW, it uses less battery then socket connection and works great :)
I'm trying to use Braintree in my Meteor application, and I've made a local package of this Braintree packaging, following the instructions of this blog post on the subject, and the install went fine.
Now though, I have this code:
// defined in server/fixtures.js
Gateway = braintree.connect({
environment: braintree.Environment.Sandbox,
merchantId: "secret",
publicKey: "secret",
privateKey: "secret"
});
and it's throwing this error:
ReferenceError: braintree is not defined
(etc....)
I then tried throwing in this line as recommended by the Braintree documentation, but it simply throws an error that "require" isn't defined.
var braintree = require("braintree");
The Braintree docs uses Express methodologies to make everything happen, but that's not a lot of help here.
The package I referenced earlier defines it's server.js with this single line:
Braintree = Npm.require("braintree");
so I tried changing my references to Braintree rather than braintree, but this was undefined the exact same way.
How do I get at Braintree to use it?
Thanks in advance!
Server packages require that symbols used outside of the package be exported with api.export. It looks like the package you referenced was built prior to meteor v0.6.5. As I recall, this video on EventedMind explains how all of this works. I suspect the solution to your problem is just to make your package.js look something like:
Package.on_use(function (api) {
api.export('Braintree');
api.use(...);
api.add_files(...);
});
I am just starting with Meteor and working on an existing project. I am running into an issue with one of the packages(observatory-apollo) that's has the following line:
__meteor_bootstrap__.app.use Observatory.logger #TLog.useragent
It is complaining that __meteor_bootstrap__.app is undefined.
What is __meteor_boostrap__ exactly? I can't seem to find a description of what it is but from threads, people seem to know how to use it. I can only see it defined in boot.js, but it doesn't really tell me much...
Meteor uses connect npm module under the hood for various reasons, to serve static files, for example. __meteor_bootstrap__.app was the reference to connect app instance.
Before it was __meteor_bootstrap__.app but it changed couple of releases ago and became WebApp.connectHandlers object and is part of WebApp package.
WebApp is a standard package of Meteor, core package for building webapps. You don't usually need to add explicitly as it is a dependency of standard-app-packages.
Example of usage the connectHandlers is to inject connect middlewares in the same way as you would use any connect middleware (or some express middlewares, express is built on top of connect):
WebApp.connectHandlers
.use(connect.query())
.use(this._config.requestParser(bodyParser))
You can look at meteor-router Atmosphere package and take it as an example: https://github.com/tmeasday/meteor-router/blob/master/lib/router_server.js
More about connect: https://npmjs.org/package/connect