@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { tokenlyFanUserIdentitySubAppSession = (TokenlyFanUserIdentitySubAppSession) appSession; moduleManager = tokenlyFanUserIdentitySubAppSession.getModuleManager(); errorManager = appSession.getErrorManager(); setHasOptionsMenu(false); settingsManager = tokenlyFanUserIdentitySubAppSession.getModuleManager().getSettingsManager(); try { if (tokenlyFanUserIdentitySubAppSession.getAppPublicKey() != null) { tokenlyFanPreferenceSettings = settingsManager.loadAndGetSettings( tokenlyFanUserIdentitySubAppSession.getAppPublicKey()); } else { // TODO: Joaquin: Lo estoy poniendo con un public key hardcoded porque en este punto no // posee public key. tokenlyFanPreferenceSettings = settingsManager.loadAndGetSettings("123456789"); } } catch (Exception e) { tokenlyFanPreferenceSettings = null; } if (tokenlyFanPreferenceSettings == null) { tokenlyFanPreferenceSettings = new TokenlyFanPreferenceSettings(); tokenlyFanPreferenceSettings.setIsPresentationHelpEnabled(false); if (settingsManager != null) { if (tokenlyFanUserIdentitySubAppSession.getAppPublicKey() != null) { settingsManager.persistSettings( tokenlyFanUserIdentitySubAppSession.getAppPublicKey(), tokenlyFanPreferenceSettings); } else { settingsManager.persistSettings("123456789", tokenlyFanPreferenceSettings); } } } // if(moduleManager.getAllIntraWalletUsersFromCurrentDeviceUser().isEmpty()){ // moduleManager.createNewIntraWalletUser("John Doe", null); // } } catch (Exception ex) { errorManager.reportUnexpectedSubAppException( SubApps.TKY_FAN_IDENTITY_SUB_APP, UnexpectedSubAppExceptionSeverity.DISABLES_THIS_FRAGMENT, ex); } }
private void setUpIdentity() { try { identitySelected = (Fan) tokenlyFanUserIdentitySubAppSession.getData(SessionConstants.IDENTITY_SELECTED); if (identitySelected != null) { loadIdentity(); } else { List<Fan> lst = moduleManager.listIdentitiesFromCurrentDeviceUser(); if (!lst.isEmpty()) { identitySelected = lst.get(0); } if (identitySelected != null) { loadIdentity(); isUpdate = true; createButton.setText("Save changes"); } } } catch (Exception e) { e.printStackTrace(); } }