DX Application Performance Management

Expand all | Collapse all

Turn off Location Request permissions on Android

Jump to Best Answer
  • 1.  Turn off Location Request permissions on Android

    Posted 02-15-2017 02:37 PM

    Hi Everyone,

    Anyone know how to disable the request for location permissions in AXA? What happens is that this request is interfering with popup messages from the application when it is not active.



  • 2.  Re: Turn off Location Request permissions on Android

    Posted 02-15-2017 02:42 PM

    Hi Carlos:

       Asking internally for assistance. Hoping someone responds.

    Thanks

    Hal German



  • 3.  Re: Turn off Location Request permissions on Android

     
    Posted 02-15-2017 03:59 PM

    Please run the attached script, changing your tenant/appID and username/password options.

    The script will not ask for location during active usage of the app and in the background.

     

    If you are unable to download the script, please reach out to me at lakha01@ca.com

    The script can be run on any UNIX environment (Mac OSX or Linux  - CentOS, RHEL etc.)

     

    Change the following properties in the script to match your data

     

     

    #replace the values for the ones below

    APPID=your_app_id

    USER=your_axa_login_info

    COHORT=your_axa_tenant_info

    PASS=your_axa_tenant_login_password

    SERVER=your_axa_server_info

    #COLLECT_LOCATION attributeid=110 default=1 (Yes) 0 (No)

    ATTRIBUTID=110

    ATTRIBUTEVALUE=1



  • 4.  Re: Turn off Location Request permissions on Android

    Posted 02-15-2017 09:52 PM

    Hi Harish,

    Thank You for the help. When I execute the script, it show me:

    NoLocalizacion_RODRIGO.BRANDARIZ@TDILATAM.COM_profile

    Using Server : https://axa.trials.ca.com with User : RODRIGO.BRANDARIZ@TDILATAM.COM and cohort : RODRIGO.BRANDARIZ@TDILATAM.COM

    TOKEN:
    TOKEN: 7525a1c0-8dc1-4179-b34b-c4ba8f28f0a1
    ENC_AUTHZ eyJ0a24iOiI3NTI1YTFjMC04ZGMxLTQxNzktYjM0Yi1jNGJhOGYyOGYwYTEiLCJ0IjoiUk9EUklHTy5CUkFOREFSSVpAVERJTEFUQU0uQ09NIn0K

     

    Getting profile NoLocalizacion_RODRIGO.BRANDARIZ@TDILATAM.COM_profile for appId 'NoLocalizacion' belonging to cohort 'RODRIGO.BRANDARIZ@TDILATAM.COM'
    curl -H Authorization: Bearer eyJ0a24iOiI3NTI1YTFjMC04ZGMxLTQxNzktYjM0Yi1jNGJhOGYyOGYwYTEiLCJ0IjoiUk9EUklHTy5CUkFOREFSSVpAVERJTEFUQU0uQ09NIn0K
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    188 188 188 188 0 0 209 0 --:--:-- --:--:-- --:--:-- 1678
    Application profile name: {
    "code" : 203051162,
    "msg" : "Could not get profile for appId, NoLocalizacion",
    "desc" : "Failed to get profile for appIdNoLocalizacion. Make sure your application is registered."
    }


    You have profile : {
    "code" : 203051162,
    "msg" : "Could not get profile for appId, NoLocalizacion",
    "desc" : "Failed to get profile for appIdNoLocalizacion. Make sure your application is registered."
    }

    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    188 188 188 188 0 0 207 0 --:--:-- --:--:-- --:--:-- 1709
    Application profile id: {
    "code" : 203051162,
    "msg" : "Could not get profile for appId, NoLocalizacion",
    "desc" : "Failed to get profile for appIdNoLocalizacion. Make sure your application is registered."
    }

    Updating profile attribute value
    curl -H Authorization: Bearer eyJ0a24iOiI3NTI1YTFjMC04ZGMxLTQxNzktYjM0Yi1jNGJhOGYyOGYwYTEiLCJ0IjoiUk9EUklHTy5CUkFOREFSSVpAVERJTEFUQU0uQ09NIn0K https://axa.trials.ca.com/mdo/v1/profiles/{ "code" : 203051162, "msg" : "Could not get profile for appId, NoLocalizacion", "desc" : "Failed to get profile for appIdNoLocalizacion. Make sure your application is registered." }/attribute
    ./updateProfileAttributes.sh: line 118: json: command not found
    ./updateProfileAttributes.sh: line 118: json: command not found
    curl: (3) [globbing] unmatched brace at pos 44


    curl: (6) Couldn't resolve host '%20%20"code"%20:%20203051162,'

    curl: (6) Couldn't resolve host '%20%20"msg"%20:%20"Could%20not%20get%20profile%20for%20appId,%20NoLocalizacion",'

    curl: (6) Couldn't resolve host '%20%20"desc"%20:%20"Failed%20to%20get%20profile%20for%20appIdNoLocalizacion.%20Make%20sure%20your%20application%20is%20registered."'


    https://axa.trials.ca.com/mdo/v1/profiles/app/NoLocalizacion?profile_id={ %20%20"code"%20:%20203051162, %20%20"msg"%20:%20"Could%20not%20get%20profile%20for%20appId,%20NoLocalizacion", %20%20"desc"%20:%20"Failed%20to%20get%20profile%20for%20appIdNoLocalizacion.%20Make%20sure%20your%20application%20is%20registered." }
    Update profile for the app to call the JMS Event Notifier
    curl -X PUT https://axa.trials.ca.com/mdo/v1/profiles/app/NoLocalizacion?profile_id={
    %20%20"code"%20:%20203051162,
    %20%20"msg"%20:%20"Could%20not%20get%20profile%20for%20appId,%20NoLocalizacion",
    %20%20"desc"%20:%20"Failed%20to%20get%20profile%20for%20appIdNoLocalizacion.%20Make%20sure%20your%20application%20is%20registered."
    } -H Authorization: Bearer eyJ0a24iOiI3NTI1YTFjMC04ZGMxLTQxNzktYjM0Yi1jNGJhOGYyOGYwYTEiLCJ0IjoiUk9EUklHTy5CUkFOREFSSVpAVERJTEFUQU0uQ09NIn0K --header Content-Type:application/json | json | json
    ./updateProfileAttributes.sh: line 127: json: command not found
    ./updateProfileAttributes.sh: line 127: json: command not found
    curl: (3) [globbing] unmatched brace at pos 74


    curl: (6) Couldn't resolve host '%20%20"code"%20:%20203051162,'

    curl: (6) Couldn't resolve host '%20%20"msg"%20:%20"Could%20not%20get%20profile%20for%20appId,%20NoLocalizacion",'

    curl: (6) Couldn't resolve host '%20%20"desc"%20:%20"Failed%20to%20get%20profile%20for%20appIdNoLocalizacion.%20Make%20sure%20your%20application%20is%20registered."'

     

    What can I do to change the location attribute?



  • 5.  Re: Turn off Location Request permissions on Android
    Best Answer

    Posted 02-16-2017 08:11 AM

    Hi Carlos:

       It looks like you have a case 00672240 on this topic. Please work this issue through the case. You may report back any updates/solutions to help others experiencing this

     

    Thanks

    Hal German



  • 6.  Re: Turn off Location Request permissions on Android

    Posted 02-21-2017 09:11 PM

    Hi Everyone,
    I upload the script:

     

    #This script is used to update the profile attribute for an appId belonging to a tenant
    #Make sure your application is registered with the COHORT before using this script
    #Update the APPID,USER,COHORT,PASS,SERVER,ATTRIBUTEID and ATTRIBUTEVALUE for which the attribute needs to be updated
    #Available AttributeIds and AttributeValues:
    #AttributeId | Description
    #------------------------------------------------------------------------
    #100 | Session timeout period in millisecond
    #105 | SDK Log levels 0-OFF, 1-ERROR, 2-WARN, 3-DEBUG 4-INFO
    #110 | Collect location details 0-None, 1-Once, 2-Always
    #115 | Upload on wifi only 0-False, 1-True
    #120 | Collect resources 0 - No (fastest), 1 - url only (default), 2 . url + status code + data stats (expensive)
    #125 | Percentage to Sample App Activity Data
    #200 | Crashes
    #220 | Screen Capture 0-OFF 1-ON
    #225 | Orientation
    #230 | Application Start time
    #405 | Http Response time
    #410 | Http Errors
    #415 | Http Data received
    #420 | Http Data sent
    #300 | CPU usage
    #305 | Memory usage
    #310 | Disk usage
    #315 | Framerate per second
    #500 | Remote Support
    #505 | APM Support 0-OFF, 1-ON
    #510 | Auto Transactions 0-OFF, 1-ON
    #515 | MAA Data Reporting 0-TRUE, 1-FALSE
    #700 | Key expiry period in years
    #705 | Revoked or Expired key grace period in days

    #replace the values for the ones below
    APPID=NoLocalizacion
    USER=RODRIGO.BRANDARIZ@TDILATAM.COM
    COHORT=RODRIGO.BRANDARIZ@TDILATAM.COM
    PASS=CaAxa2015*
    SERVER=https://axa.trials.ca.com
    ATTRIBUTID=110
    ATTRIBUTEVALUE=0
    #PROFILENAME=NoLocalizacion

    PROFILENAME="${APPID}_${COHORT}_profile";
    #If tenant created using MCC-UI , uncomment the line below and use this as the profile name
    #PROFILENAME="${APPID}_${COHORT}-USERSTORE_profile";
    echo $PROFILENAME

    cohort=`echo $COHORT | openssl enc -base64`
    echo
    echo Using Server : $SERVER with User : $USER and cohort : $COHORT
    echo

    TOKEN=`curl -s -X POST -H "Authorization: Basic $cohort" -d "grant_type=PASSWORD&username=$USER&password=$PASS" $SERVER/ess/security/v1/token|grep tkn |grep -v rtkn|awk -F\" '{print $4}'`

    echo "TOKEN:" $TOKEN

    if [ -z "$TOKEN" ]; then
    TOKEN=`curl -s -X POST -H "Authorization: Basic $cohort" -d "grant_type=PASSWORD&username=$USER&password=$PASS" $SERVER/ess/security/v1/token|awk -F, '{print $2}' |awk -F\" '{print $4}'`

    echo "TOKEN:" $TOKEN
    if [ -z "$TOKEN" ]; then
    echo no token
    exit 1
    fi
    fi

    ENC_AUTHZ=`echo \{\"tkn\":\"$TOKEN\",\"t\":\"$COHORT\"\} | openssl enc -base64 -A`
    echo 'ENC_AUTHZ' $ENC_AUTHZ
    echo


    URL_GET_PROFILE=$SERVER/mdo/v2/profiles/${APPID}
    URL_GET_PROFILE_E=${URL_GET_PROFILE// /%20}

    echo
    echo
    echo "Getting profile ${PROFILENAME} for appId '${APPID}' belonging to cohort '${COHORT}'"
    echo curl -H "Authorization: Bearer $ENC_AUTHZ" $URL_CU_PROFILE
    PROFILENAME=$(curl -X GET $URL_GET_PROFILE_E -H "Authorization: Bearer $ENC_AUTHZ" --header "Content-Type:application/json" | sed -e 's/^.*"profileName":"\([^"]*\)".*$/\1/')
    echo Application profile name: "$PROFILENAME"

    echo
    echo


    URL_CU_PROFILE=$SERVER/mdo/v1/profiles/create/${APPID}
    URL_U_ATTR=$SERVER/mdo/v1/profiles/$PROFILENAME/attribute
    URL_CU_PROFILE_E=${URL_CU_PROFILE// /%20}
    URL_U_ATTR_E=${URL_U_ATTR// /%20}

     

    if [ "$PROFILENAME" == "Default" ]; then
    echo "You have a Default profile. We will create a new profile for this application based on Default"
    PROFILENAME="${APPID}_${COHORT}_profile";
    #If tenant created using MCC-UI , uncomment the line below and use this as the profile name
    #PROFILENAME="${APPID}_${COHORT}-USERSTORE_profile";
    echo $PROFILENAME
    echo "Creating/Updating profile ${PROFILENAME} for appId '${APPID}' belonging to cohort '${COHORT}'"
    echo curl -H "Authorization: Bearer $ENC_AUTHZ" $URL_CU_PROFILE
    curl -X POST $URL_CU_PROFILE_E -H "Authorization: Bearer $ENC_AUTHZ" --header "Content-Type:application/json" | json | json
    echo
    echo
    echo
    else
    echo "You have profile : $PROFILENAME"
    fi
    echo

    PROFILEID=$(curl -X GET $URL_GET_PROFILE_E -H "Authorization: Bearer $ENC_AUTHZ" --header "Content-Type:application/json" | sed -e 's/^.*"profileId":\([^",]*\).*$/\1/')
    echo Application profile id: "$PROFILEID"

    echo
    echo "Updating profile attribute value"
    echo curl -H "Authorization: Bearer $ENC_AUTHZ" $URL_U_ATTR
    curl -X PUT -d '{"attributes":[{ "attributeId": "'$ATTRIBUTID'", "value": "'$ATTRIBUTEVALUE'"}]}' $URL_U_ATTR_E -H "Authorization: Bearer $ENC_AUTHZ" --header "Content-Type:application/json" | json | json
    echo
    echo



  • 7.  Re: Turn off Location Request permissions on Android

    Posted 02-22-2017 08:29 AM

    Hi Carlos:

       Thanks for the script. Given that you are working through the case mentioned above with my colleagues, I will just note that it was added here.

     

    Thanks

    Hal German