Commit f4ea5c46 by Kunj Gupta

Made some changes in V-Portal flavor.

parent 71687a9d
......@@ -17,6 +17,12 @@ repositories {
android {
flavorDimensions "tier"
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('/Users/chaukadev/.android/debug.keystore')
storePassword 'android'
}
config {
keyAlias 'Uofl'
keyPassword 'Vsoft@123'
......@@ -47,14 +53,20 @@ android {
buildConfigField "int", "BUILD_TYPE_INT", "2"
signingConfig signingConfigs.config
}
staging {
initWith debug
staging { //staging is the UAT environment
applicationIdSuffix ".staging"
buildConfigField "int", "BUILD_TYPE_INT", "3"
signingConfig signingConfigs.debug
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
productFlavors {
uofl{
uofl {
applicationId "com.vsoft.servicenow.uofl"
}
citrix {
......@@ -79,7 +91,7 @@ dependencies {
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.google.android.gms:play-services-analytics:11.8.0'
compile 'com.google.android.gms:play-services-analytics:12.0.1'
//compile 'com.google.dagger:dagger:2.0'
//annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
......@@ -88,14 +100,13 @@ dependencies {
}
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.nkzawa:socket.io-client:0.3.0'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:animated-vector-drawable:27.0.2'
compile 'com.android.support:support-media-compat:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:animated-vector-drawable:27.1.0'
compile 'com.android.support:support-media-compat:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.google.firebase:firebase-messaging:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
......@@ -2,10 +2,18 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.vsoft.servicenow">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:icon="@mipmap/ge_launcher"
android:icon="@mipmap/ic_launcher"
tools:replace="android:icon">
<activity
android:name=".chat.ChatActivity"
android:label="@string/chat_activity_label"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
......@@ -10,7 +10,6 @@ import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.MotionEvent;
......@@ -249,7 +248,7 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.e(TAG, "diconnected");
CatalogueLog.e("diconnected");
isConnected = false;
Toast.makeText(getApplicationContext(),
R.string.disconnect, Toast.LENGTH_LONG).show();
......@@ -267,7 +266,7 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.e(TAG, "Error connecting");
CatalogueLog.e("Error connecting");
Toast.makeText(getApplicationContext(),
R.string.error_connect, Toast.LENGTH_LONG).show();
}
......@@ -291,7 +290,7 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
username = data.getString(NEW_MESSAGE_USER_NAME);
message = data.getString(NEW_MESSAGE_MESSAGE);
} catch (JSONException e) {
Log.e(TAG, e.getMessage());
CatalogueLog.e(e.getMessage());
return;
}
......@@ -307,7 +306,7 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
private Emitter.Listener authenticated = new Emitter.Listener() {
@Override
public void call(final Object... args) {
Log.e(TAG, "authorized user: "+args[0]);
CatalogueLog.e("authorized user: "+args[0]);
runOnUiThread(new Runnable() {
@Override
public void run() {
......@@ -333,7 +332,7 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
@Override
public void run() {
//TODO : need to check if access token is valid or not.
Log.e(TAG, "unauthorized user: "+args[0]);
CatalogueLog.e("unauthorized user: "+args[0]);
Toast.makeText(getApplicationContext(),
R.string.unauthorized_user, Toast.LENGTH_LONG).show();
}
......@@ -342,8 +341,8 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
};
private void refreshTokenApiTask() {
Log.d(Constants.TAG, "-- is 401, try refresh token...");
Log.d(Constants.TAG, "refresh token: " + PrefManager.getSharedPref(this, PrefManager.PREFERENCE_REFRESH_TOKEN));
CatalogueLog.d("-- is 401, try refresh token...");
CatalogueLog.d("refresh token: " + PrefManager.getSharedPref(this, PrefManager.PREFERENCE_REFRESH_TOKEN));
SyncStatus status = LoginApiManager.refreshLogin(this, PrefManager.getSharedPref(this, PrefManager.PREFERENCE_REFRESH_TOKEN));
if (status == SyncStatus.SUCCESS) {
CatalogueLog.d("refresh token success, retry same...");
......@@ -358,11 +357,11 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
String url = "url";
String authentication = "authentication";
Log.e(TAG, "USER IS TRYING TO MAKING AUTHORIZED CONNECTION");
CatalogueLog.e("USER IS TRYING TO MAKING AUTHORIZED CONNECTION");
// TODO : pass the user auth token to chat server
//sending token to server
String accessToken = PrefManager.getSharedPref(ChatActivity.this, PrefManager.PREFERENCE_ACCESS_TOKEN);
Log.e(TAG, "Access Token "+accessToken);
CatalogueLog.e("Access Token "+accessToken);
String loginUserName = PrefManager.getSharedPref(ChatActivity.this, PrefManager.PREFERENCE_LOGIN_USER_NAME);
if(!TextUtils.isEmpty(accessToken) && !TextUtils.isEmpty(loginUserName)) {
String userDetailURL = Constants.CHAT_USER_API_URL + "?" + Constants.URL_PARAM_SYSPRM_USERNAME + "=" + loginUserName;
......@@ -376,7 +375,7 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
}
mSocket.emit(authentication, jsonObject);
} else {
Log.e(TAG, "Access Token is empty.");
CatalogueLog.e("Access Token is empty.");
Toast.makeText(getApplicationContext(),
R.string.error_connect, Toast.LENGTH_LONG).show();
}
......
......@@ -80,15 +80,6 @@ public class LoginScreen extends Activity {
CatalogueApplication application = (CatalogueApplication) getApplication();
Tracker tracker = application.getDefaultTracker();
Util.sendScreenName(tracker, getString(R.string.login_screen_string));
//set login details
String packageName = this.getApplicationContext().getPackageName();
if(packageName.contains(".debug")){
//demo1 instance - development & internal testing
mUserNameEditText.setText("prasad.k");
mPasswordEditText.setText("Vsoft@123");
}
}
private void CheckLoginValues() {
......
......@@ -71,40 +71,25 @@ public class Constants {
/**
* Decides the URLS used
*/
private static final String DOMAIN_RELEASE = AppConfig.DOMAIN_RELEASE;
private static final String DOMAIN_DEBUG = AppConfig.DOMAIN_DEBUG;
private static final String DOMAIN_RELEASE = AppConfig.DOMAIN_RELEASE;
private static final String DOMAIN_STAGING = AppConfig.DOMAIN_STAGING;
private static final String API_PATH_RELEASE = "/api/now/table/";
private static final String API_PATH_DEBUG = "/api/now/table/";
private static final String API_PATH_RELEASE = "/api/now/table/";
private static final String API_PATH_STAGING = "/api/now/table/";
private static final int BUILD_TYPE_DEBUG = 1;
private static final int BUILD_TYPE_RELEASE = 2;
private static final int BUILD_TYPE_STAGING = 3;
/**
* Decides the Api auth data used
*/
private static final String API_AUTH_PARAM_USER_NAME_RELEASE = "vsoft.admin";
private static final String API_AUTH_PARAM_PASSWORD_RELEASE = "v50ft@123456";
private static final String API_AUTH_PARAM_USER_NAME_DEBUG = "a0kuma18";
private static final String API_AUTH_PARAM_PASSWORD_DEBUG = "v$0ftA$win";
public static final String API_AUTH_PARAM_USER_NAME = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? API_AUTH_PARAM_USER_NAME_RELEASE
: API_AUTH_PARAM_USER_NAME_DEBUG);
public static final String API_AUTH_PARAM_PASSWORD = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? API_AUTH_PARAM_PASSWORD_RELEASE
: API_AUTH_PARAM_PASSWORD_DEBUG);
private static final String API_PATH = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
private static final String API_PATH = BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? API_PATH_RELEASE
: API_PATH_DEBUG);
: (BUILD_TYPE_DEBUG == BuildConfig.BUILD_TYPE_INT ? API_PATH_DEBUG : API_PATH_STAGING);
private static final String DOMAIN_FROM_BUILD = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
private static final String DOMAIN_FROM_BUILD = BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? DOMAIN_RELEASE
: DOMAIN_DEBUG);
: (BUILD_TYPE_DEBUG == BuildConfig.BUILD_TYPE_INT ? DOMAIN_DEBUG : DOMAIN_STAGING);
/**
* Decides the Client data used
*/
......@@ -114,13 +99,16 @@ public class Constants {
private static final String LOGIN_CLIENT_ID_DEBUG = AppConfig.LOGIN_CLIENT_ID_DEBUG;
private static final String LOGIN_CLIENT_SECRET_DEBUG = AppConfig.LOGIN_CLIENT_SECRET_DEBUG;
private static final String LOGIN_CLIENT_ID_STAGING = AppConfig.LOGIN_CLIENT_ID_STAGING;
private static final String LOGIN_CLIENT_SECRET_STAGING = AppConfig.LOGIN_CLIENT_SECRET_STAGING;
public static final String LOGIN_CLIENT_ID = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? LOGIN_CLIENT_ID_RELEASE
: LOGIN_CLIENT_ID_DEBUG);
: (BUILD_TYPE_DEBUG == BuildConfig.BUILD_TYPE_INT ? LOGIN_CLIENT_ID_DEBUG : LOGIN_CLIENT_ID_STAGING));
public static final String LOGIN_CLIENT_SECRET = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? LOGIN_CLIENT_SECRET_RELEASE
: LOGIN_CLIENT_SECRET_DEBUG);
: (BUILD_TYPE_DEBUG == BuildConfig.BUILD_TYPE_INT ? LOGIN_CLIENT_SECRET_DEBUG : LOGIN_CLIENT_SECRET_STAGING));
/**
* Domain to use
......
<manifest package="com.vsoft.servicenow"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.vsoft.servicenow">
<application>
<application
android:icon="@mipmap/ic_launcher"
tools:replace="android:icon">
<activity
android:name="com.vsoft.servicenow.chat.ChatActivity"
android:screenOrientation="portrait"/>
android:name=".chat.ChatActivity"
android:label="@string/chat_activity_label"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
......@@ -67,6 +67,37 @@
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:222593508124:android:ade631ceed1f3560",
"android_client_info": {
"package_name": "com.vsoft.servicenow.vportal.staging"
}
},
"oauth_client": [
{
"client_id": "222593508124-1jq94gaia4oahk321cd8ud74jv6tqgr3.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyALtTZoenaAEMfqvBLlHRsAU4P_aoOYBLg"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
......
......@@ -16,11 +16,21 @@ public class AppConfig {
public static final String LOGIN_CLIENT_ID_DEBUG = "091b5d1ea97cd700e4268b90dd5521ca";
public static final String LOGIN_CLIENT_SECRET_DEBUG = "+tPJ@jS<;S";
public static final String LOGIN_CLIENT_ID_STAGING = "091b5d1ea97cd700e4268b90dd5521ca";
public static final String LOGIN_CLIENT_SECRET_STAGING = "+tPJ@jS<;S";
/**
* API Base URL
* */
public static final String DOMAIN_RELEASE = "https://ven01199.service-now.com/";
public static final String DOMAIN_DEBUG = "https://vsoftconsultingtest.service-now.com/";
public static final String DOMAIN_STAGING = "https://vsoftconsultingtest.service-now.com/";
/**
* Web services urls
*/
/*Catalogue Category API */
public static final String URL_GET_CATALOGUE = "api/vsng2/uofl_mobile/catalogue_variable_screen";
public static final String URL_GET_CATALOGUE = "api/vsng2/uofl_mobile/catalogue_screen";
/*Catalogue Category Items API */
public static final String URL_GET_CATALOGUE_ITEM = "api/vsng2/uofl_mobile/catalog_item";
......@@ -30,29 +40,4 @@ public class AppConfig {
public static final String URL_GET_UI_POLICY = "/api/vsng2/uofl_mobile/uipolicy";
public static final String URL_GET_VARIABLE_CHOICE = "/api/vsng2/uofl_mobile/question_choice";
public static final String URL_POST_CATALOGUE_ITEM = "api/vsng2/uofl_mobile";
public static final String DOMAIN_RELEASE = "https://vsoftconsultingtest.service-now.com/";
public static final String DOMAIN_DEBUG = "https://vsoftconsultingtest.service-now.com/";
/**
* initializing the environment urls
* @param context
*/
public static void initEnvironmentUrl(Context context){
String packageName = context.getApplicationContext().getPackageName();
if(packageName.contains(".debug")){
//demo1 instance - development & internal testing
// DOMAIN_RELEASE = "https://ven01199.service-now.com/";
// DOMAIN_DEBUG = "https://ven01199.service-now.com/";
}else if(packageName.contains(".staging")){
//test instance - staging for UAT
// DOMAIN_RELEASE = "https://ven01199.service-now.com/";
// DOMAIN_DEBUG = "https://ven01199.service-now.com/";
}else {
//release url - production for play store release
// DOMAIN_RELEASE = "https://ven01199.service-now.com/";
// DOMAIN_DEBUG = "https://ven01199.service-now.com/";
}
}
}
......@@ -36,9 +36,5 @@ public class MenuProvider {
.setTitle(R.string.home_screen_chat_title)
.setMenuIconResId(R.string.home_screen_chat_icon)
.build()
// new NotificationMenuItemData.Builder()
// .ChatMenuItemData(R.string.home_screen_notification_title)
// .setMenuIconResId(R.string.home_screen_notification_icon)
// .build()
);
}
......@@ -17,9 +17,5 @@
<string name="home_screen_chat_title">Chatbot</string>
<string name="home_screen_chat_icon">chatbot</string>
<string name="home_screen_notification_title">Notifications</string>
<string name="home_screen_notification_icon">notifications</string>
<!--End-->
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment