Hi Guys,
I am using samsung Z1 phone for Native Application development. I need to know the SIM card Subscriber number for my app.
I tried below code to get the subscriber number
-----------------------------------------------------------------------------------
/* telephone init */
telephony_handle_list_s handle_list;
int ret = telephony_init(&handle_list);// In case of single SIM, we get only one handle
if (ret != TELEPHONY_ERROR_NONE){
dlog_print(DLOG_ERROR, LOG_TAG, "failed to get handle list");
return;
}
/* phone number */
char *subscriber_number;
subscriber_number = NULL;
ret = telephony_sim_get_subscriber_number(handle_list.handle[0], &subscriber_number);
if (ret != TELEPHONY_ERROR_NONE){
dlog_print(DLOG_ERROR, LOG_TAG, "Error in fetching phone number");
return;
}
if(subscriber_number != NULL){
dlog_print(DLOG_INFO, LOG_TAG, "subscriber_number = %s", subscriber_number);
free(subscriber_number);
}else{
dlog_print(DLOG_ERROR, LOG_TAG, "Subscriber number is not stored in SIM Card");
}
----------------------------------------------------------------------------------------
Above code always print "Subscriber number is not stored in SIM Card" log. Means API got succeeded but it gave NULL subscriber number.
I added http://tizen.org/privilege/telephony privilege in menifest file.
Do I need partner privilege to get subscriber number?
Thank you.