Parse CloudCode won't show my app - android

I'm beginning to use CloudCode but I can't find my application after authentication.
Once I enter my email account and pass I get the following:
Email:
Pass:
1: results
Select an App:
From this step nothing works (Ex. parse deploy) and I get the error msg "Unknown application _default"
I'm using the latest parse-windows.2.0.11.exe, PowerShell on Win8.1
Should CloudCode be activate on the project in order to use it? if so, how is this done?
===UPDATE===
It turns out the global.json was created wrong (bug?)
{
"applications": {
"results": {
"applicationId": {
"appName": "AppName1",
"applicationId": "zzz",
"masterKey": "zzz"
},
"masterKey": {
"appName": "AppName2",
"applicationId": "xxx",
"masterKey": "xxx"
}
}
}
}
I've manually fixed it using this thread link
Hope this will help others..
=== END UPDATE===
Please advise.
Thanks,
Liran

My experience is with Android over Linux, but from what I see the base is the same - in Linux you create a folder for your CloudCode that you reference for deployments, so when you deploy you do that from inside that folder, read carefully through This Parse Tutorial - seems pretty similar.

Related

TypeError: sockets.forEach is not a function

i am trying to create a simple personal chat with node js and android.the following code works fine
socket.on('message' , function (msg) {
console.log(msg);
io.emit('message' , {message : msg});
})
when a message is receive from a client, the server send it to all other client connected to the server. but the problem is that the sender receive his own message as well. to overcome this issue i am using the following code
socket.on('message' , function (msg) {
console.log(msg);
//io.emit('message' , {message : msg});
var sockets = io.sockets.sockets;
sockets.forEach(function (sock) {
if(sock.id != socket.id){
sock.emit('message' , {message:msg})
}
})
})
but the code above produces an error
TypeError: sockets.forEach is not a function
can anyone help me with this and save my day? thanks in advance.
As for Socket.io v1.4.5, it should be:
Object.keys(io.sockets.sockets);
This returns an array containing id's of sockets connected and you can apply forEach on it.
Object.keys(io.sockets.sockets).forEach(function(id) {
console.log("ID:",id) // socketId
});
To send a message to a particular socket, you can use:
io.to(socketId).emit()
This worked for me:
I input npm install socket.io#1.3.5 --save in commandline
It's because of the version. Go to package.json and change like this:
..
.
..
..
"dependencies": {
"express": "^4.17.1",
"socket.io": "^1.3.5"
},

IBM Watson Visual Recognition : UnauthorizedException

I am getting com.ibm.watson.developer_cloud.service.exception.UnauthorizedException: Unauthorized: Access is denied due to invalid credentials error while i am using the right credentials. I am doing like this..
Imports :
import com.ibm.watson.developer_cloud.visual_recognition.v2_beta.VisualRecognition;
import com.ibm.watson.developer_cloud.visual_recognition.v2_beta.model.VisualClassification;
Code :
service = new VisualRecognition(VisualRecognition.VERSION_DATE_2015_12_02);
service.setUsernameAndPassword("GXXXXxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
File image = new File("src/test/resources/visual_recognition/car.png");
VisualClassification result = service.classify(image).execute();
Dependencies :
compile 'com.ibm.watson.developer_cloud:java-sdk:3.0.0-RC1'
Where on Bluemix the Visual Recognition credentials are like this
{
"credentials": {
"url": "https://gateway.watsonplatform.net/visual-recognition-beta/api",
"password": "GXXXXxxxxxxx",
"username": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
Please help me to solve the issue. Thanks in advance!
This may be an error in your question, rather than an error in your code, however please double check that you pass to setUsernameAndPassword method the parameters in the correct order (username, password) as specified in the API Reference. Looking at your code I see
service.setUsernameAndPassword("GXXXXxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
that is (password, username). I've just tried using the correct order and it works fine for me.

GET a collection fails on phone but works fine on computer

My code fetches the apigee collection fine when running on the desktop with Chrome browser.
When I turn it into an app via phonegap/android-studio and run it on my android phone it shows my alert: "error fetching remote candidate data" that means fetch returned an error.
Why would this fetch the collection on the desktop but not the phone?
(guest has GET permissions for the collection)
function loadRemoteData() {
endorseds = new Apigee.Collection({
"client": client,
"type": "endorseds",
"qs": {
"limit": 4000,
"ql": "order by order,district,name"
}
});
$.mobile.loading("show");
endorseds.fetch(function(err, data) {
if (err) { alert("error fetching remote candidate data ");
if(lastLocalDate > 0){
loadLocalData();
}
$.mobile.loading("hide");
} else {
alert("remote fetch ok");
localStorage.setItem('endorseds', endorseds.serialize());
if(lastRemoteDate == 0) lastRemoteDate = getToday();
localStorage.setItem('lastdate',lastRemoteDate);
$.mobile.loading("hide");
showMain();
}
});
}
The answer depends upon the version of PhoneGap that you are using. Have a look at the config.xml file. At the bottom (by default) of the file, you should see a line where "something here" was 127.0.0.1/* in older versions of PhoneGap. I'm not sure where it got change (3.2, I believe), but it is now which allows the app to communicate with any web site/application. Change that line to the wildcard and recompile – this should solve the issue.

How to create/define Adob Omniture (adob analytics) ADBMobileConfig.json file for android

I am trying to integrate Adob Omniture analytics (Adobe Marketing Cloud) in my android application. I just want to know that, how I can configure ADBMobileConfig.json file, any guidance link. How to define value of this in json file
{
Analytics: rsids and server,
Target: clientCode,
Audience Management: server
}
Right now my json file is like this
{
"version" : "1.0",
"analytics" : {
"rsids" : "",
"server" : "",
"charset" : "UTF-8",
"ssl" : false,
"offlineEnabled" : false,
"lifecycleTimeout" : 300,
"batchLimit" : 0,
"privacyDefault" : "optedin",
"poi" : []
},
"target" : {
"clientCode" : "",
"timeout" : 2
},
"audienceManager" : {
"server" : ""
}
}
How can I implement this?
Config reference:
http://microsite.omniture.com/t2/help/en_US/mobile/android/#Adobe_Mobile_Class_and_Method_Reference
developer.omniture.com has just about everything you'd need to get going.
The link in BrettAHale's answer is unfortunately dead. After spending way too much time hunting through Adobe Marketing's ill-conceived site, Google finally found a PDF documenting the config file:
https://marketing.adobe.com/resources/help/en_US/mobile/android/android_mobile_4x.pdf
Locating the values to plug in from the Adobe Analytics (Omniture) account is another challenge all unto itself. Anyone with experience wading through that morass please do share.
Based on Adobe's past behavior, that link will likely die a horrible death as well. Might want to save that and keep it somewhere safe.
PS: For posterity http://s000.tinyupload.com/index.php?file_id=00262289428317514323

Phonegap facebook plugin for android gives me an oauthexception

seriously going insane here....
I'm trying to get the phonegap facebook plugin for android to work, but it's really driving me up the wall (no pun intented).
I am using the code from https://github.com/irnc/phonegap-plugin-facebook-connect/tree/oauth-2.0+irnc, at least I think I am.
I appear to have two problems:
the following callback in the login (from pg-plugin-fb-connect) gives an error because "FB.Auth.setAuthResponse(response.authResponse, response.status);" cannot be found. Am I using an incorrect facebook sdk? Apparently no, see edit below
PhoneGap.exec(function (response) {
console.log('PG.FB.login.success: ' + JSON.stringify(response) + ', store into localStorage ...');
localStorage.setItem(key, JSON.stringify(response));
FB.Auth.setAuthResponse(response.authResponse, response.status);
if (cb) {
cb(response);
}
}, null, service, 'login', ['publish_stream', 'read_stream']);
},
When I comment the FB.Auth.setAuthResponse(response.authResponse, response.status); statement, my login returns successfull! I get an authresponse with an accesstoken and status set to connected. When I try to execute the following code (on success callback)
FB.api('/me/feed', 'post', { message: body }, function(response) {
if (!response || response.error) {
console.log(JSON.stringify(response.error, null, 4));
alert('We are very sorry, but somthing went wrong');
} else {
alert('Message was successfully posted to your wall!');
}
});
it gives me an oauthexception message: "An active access token must be used to query information about the current user."
I authenticated with 'read_stream, publish_stream' permissions.
These two are probably related, but I can't find anything about the setAuthReponse call in the facebook api.
EDIT help is apparently not on it's way, but i've continued my quest to get this to work.
The facebook js sdk I got from the github repo's are all using the 'old' auth methods. I've downloaded the new facebook js sdk and FB.Auth.setAuthResponse is there. I copied the code to my existing js sdk and changed all calls to setSession to setAuthRepsonse. Everything is working fine, except that the access token doesn't appear to be posted when I make above FB.api calls. After these changes, the error remains exactly the same!
Oh yeah, I also changed the check in the login callback to check for authResponse instead of session (it's in the example).
Help is more than welcome,
rinze
I think I fixed this. Basically the ConnectPlugin.java is still returning a "session" response object instead of the "authResponse" that the new SDK expects.
See https://github.com/odbol/phonegap-plugin-facebook-connect/commit/0ef84e29603338930ff82fc6d6ef8525b668077d for details.

Categories

Resources