Skip to content
Mimerme edited this page Sep 1, 2015 · 2 revisions

Remember to set the lat, long, and such in YikYakProfile.java

Fetching messages

YikYakAPI.login(userid, token, useragent);
System.out.println(YikYakAPI.getYaks());

Registering users

String[] data = YikYakAPI.registerNewUser();
System.out.println("userID: " + data[0]);
System.out.println("token: " + data[1]);
System.out.println("deviceID: " + data[2]);
System.out.println("userAgent: " + data[3]);
System.out.println("Write this down somewhere");

Verify account

//This must be called first to get the verification token
//csCode - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
//prefix - https://en.wikipedia.org/wiki/List_of_country_calling_codes
//number - (xxx) xxx-xxxx
//Start to verify your account

//Returns a json with a token value, lets call it verificationToken
System.out.println(YikYakAPI.startVerifyAccount(token, csCode, number, c3Code, prefix));
//verificationCode is sent to the number
System.out.println(YikYakAPI.verifyAccount(userID,token, verificationToken, verificationCode));

Parsing

All JSON responses need to be parsed and are not supported by the library. Do this by using your favorite JSON parser and do something like

JSONObject json = new JSONObject(YikYakAPI.getYaks().text());
Clone this wiki locally