I've followed the documentation on implementing the Marketo native SDK for react native (https://developers.marketo.com/mobile/react-native/)
There are mistakes and omissions in the documentation sample code, which for Android seems to have some portion of code samples cut and pasted from React-Native's documentation on implementing a Native Module. Through trial and error, I've been able to figure out much of what the documentation is missing that was causing errors in doing a build for android.
However, I'm stuck on the use of the 'MktoException' class in the example
@ReactMethod
public void associateLead(ReadableMap leadData) {
MarketoLead mLead = new MarketoLead();
try {
mLead.setCity(leadData.getString(MarketoLead.KEY_CITY));
mLead.setFirstName(leadData.getString(MarketoLead.KEY_FIRST_NAME));
mLead.setLastName(leadData.getString(MarketoLead.KEY_LAST_NAME));
mLead.setAddress(leadData.getString(MarketoLead.KEY_ADDRESS));
mLead.setEmail(leadData.getString(MarketoLead.KEY_EMAIL));
mLead.setBirthDay(leadData.getString(MarketoLead.KEY_BIRTHDAY));
mLead.setCountry(leadData.getString(MarketoLead.KEY_COUNTRY));
mLead.setFacebookId(leadData.getString(MarketoLead.KEY_FACEBOOK));
mLead.setGender(leadData.getString(MarketoLead.KEY_GENDER));
mLead.setState(leadData.getString(MarketoLead.KEY_STATE));
mLead.setPostalCode(leadData.getString(MarketoLead.KEY_POSTAL_CODE));
mLead.setTwitterId(leadData.getString(MarketoLead.KEY_TWITTER));
marketoSdk.associateLead(mLead);
}
catch (MktoException e){
}
}
Solved! Go to Solution.
In case anyone else runs into this, the correct import for the 'MktoException' class is:
Appreciate you keeping the thread updated. Not many users of the Android SDK on here, so probably not many anywhere!