Get Blackberry Owner details (eg name/number) through API - blackberry

I know this is a simple one, but I'm not sure the name of the framework item that will help me. (I know Google could solve this one but my keyworks fail me)
I'm trying to gather some of the BlackBerry owner's details (phone number, first/last name, edit: email address) to autofill a "Create new account" screen.
I'm using DeviceInfo to return the DeviceId, but unsure how to retrieve owner contact details.

To get the phone number:
String phoneNum = net.rim.blackberry.api.phone.Phone.getDevicePhoneNumber(false);
To get the Owner's name:
String owner = net.rim.device.api.system.OwnerInfo.getOwnerName();

Related

Docusign iOS SDK directly sending envelope without opening anything also not asking to do the signature

I have created a template in docusign web and using its template id, i am calling the function from iOS SDK.
TemplatesManager.sharedInstance.displayTemplateForSignature(templateId: templateId, controller: self, tabData: tabData, recipientData: recipientData, customFields:customFields, onlineSign: onlineSign, attachmentUrl: attachmentUrl) { (controller, errMsg) in
print(errMsg)
}
The recipient data i am sending is
let recipientDatum = DSMRecipientDefault()
// Use recipient roleName (other option to use recipient-id) to find unique recipient in the template
recipientDatum.recipientRoleName = "Client"
recipientDatum.recipientSelectorType = .recipientRoleName
recipientDatum.recipientType = .inPersonSigner
// In-person-signer name
recipientDatum.inPersonSignerName = "Akshay Somkuwar"
// Host name (must match the name on the account) and email
recipientDatum.recipientName = "Akshay Somkuwar"
recipientDatum.recipientEmail = "akshay.s.somkuwar#gmail.com"
let recipientData: Array = [recipientDatum]
Same recipient is added for template in docusign website
Also i have added observers for DSMSigningCompleted and DSMSigningCancelled to get envelopeId.
Now when i am calling this function displayTemplateForSignature no screen is opening to show the PDF or To sign the PDF, without asking for signature, the envelope is directly sent to the recipient. and i am getting this response in console with notification.
name = DSMSigningCompletedNotification, object = Optional(<Public_Adjuster.AgreementSignViewController: 0x110bb8060>), userInfo = Optional([AnyHashable("templateId"): 506346f5-7adb-4132-b15f-d288aa268398, AnyHashable("signingMode"): online, AnyHashable("envelopeId"): 2eeeeda8-5b74-4930-904e-94b2ce6451ac])
I want to open the pdf for the passed templateId but its not opening the pdf nor its asking for signature, and its directly sent to the recipient.
Any help will be appreciated, Thank you.
This behaviour, sending the envelope directly, is triggered when DocuSign SDK can not find any signers in the template/envelope that matches the logged-in user. Given that you are using the recipientDefaults, ensure that your signer information on the template (preset signer on the DocuSign web) matches the Account information exactly with the recipientDefaults object.
You may compare it with .
One issue I noticed is the signer type is set to need to sign which corresponds to a remoteSigner on the DocuSign web. And on the recipientDefaults object it's set as inPersonSigner. It should be .signer corresponding to DSMRecipientTypeSigner.
recipientDatum.recipientType = .signer.
Or you may change the need to sign to in person signer on the DocuSign web.
Another suggestion is to remove the name & email from the template screenshot shared and keep that empty as the client app is passing name & email with the recipientDefaults object to the SDK.
More details: How to set recipient defaults

how to send OTP to phone number with country code in swift

Hi iam trying to send top to mobile number using Firebase Authentication,and am able to do that but my task is sending OTP to phone number and as per the country code, if the user choose wrong country code then OTP should not sent and if it is correct then only we have to send the OTP.and this OTP verification should be done only for the first time.If they already done the OTP verification after re-running the application ,we should directly go to home page.Can anyone help me to do that would be great ,thanks in advance.
I think the country code should not be editable. If it is for verification purposes only, you can get country code with the help of the below code.
let currentLocale = NSLocale.currentLocale()
let countryCode = currentLocale.objectForKey(NSLocaleCountryCode) as? String
After getting this you can append this with a mobile number like this.
let FinalNumber = String(format: "%#%#", countryCode,mobilenumber)
When it comes to navigating view controllers : this will help you

Fetching address using latitude ,longitude in GoogleMaps (Swift 4)

I got Following Error
{
"error_message" = "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 183.82.16.154, with empty referer";
results = (
);
status = "REQUEST_DENIED";
}
Please anyone give solution, Thank U.
While Creating the key google asks you to set restrictions select none there as shown in the image below

How to create contacts list like whats app did

I'm working on an app that creates an user profile. I need to be able to see who from my contacts has the app installed so that i am able to grant them access to my profile and see their profiles.
How do i get the full contact list, determine my phone number to create my account with it, and check how many people from the contacts have the app installed? (similar to how WhatsApp does it)
I know it's possible to get the contact list by using Apple API's, but do i have to send all the information to the server to check if they have the app installed?
Thank you.
I think you are managing one local database to store users locally.
First, You must have one contact mapping table on server that determines which number is allocate to which user (Each user must have unique number per account).
You have to pass array of phone numbers to your server request and fire query to get only those users whose phone numbers are in array.
You get one users objects array and that array you have to save in local database. (You can store all contacts in local database and update record (for appId, contactId, server name etc) is user is application user).
Finally these users who has appId are your application users.
Hope this concept might help you.
If you are using webservices your backend will can give the contacts which are using your application.
For getting the app contacts you have to use user phone number using phone number you can get the app user through webservices
to get all contact from Phonebook you can use below method in swift
first import Contacts
func FetchContact()
{
if #available(iOS 9.0, *) {
let contactStore = CNContactStore()
do {
let request:CNContactFetchRequest
request = CNContactFetchRequest(keysToFetch: [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactMiddleNameKey, CNContactEmailAddressesKey,CNContactPhoneNumbersKey])
request.sortOrder = CNContactSortOrder.GivenName
try contactStore.enumerateContactsWithFetchRequest(request) {
(contact, cursor) -> Void in
self.dataArray?.addObject(contact)
}
}
catch{
print("Handle the error please")
}
//self.collectionView?.reloadData()
}
}

BlackBerry add new contact to address book

the Blackberry app I'm working at requires me to export all app contacts to the BB address book. I'm able to retrieve the ContactList and create a new contact. However, when I call
AddressBookArguments entry =
new AddressBookArguments(AddressBookArguments.ARG_NEW, contact);
Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, entry);
I'll have the new contact page of the address book poped up and have to manually press the save button. I can't let the user do this for all the contacts.
So my question is, is there a way to auto-save these newly created contacts?
You can certainly create new contacts programmatically.
Here is some sample code that creates a new contact with a company name and an email address. You can extend this with other fields, such as name, phone number, etc.
ContactList contactList = (ContactList)PIM.getInstance().openPIMList(
PIM.CONTACT_LIST, PIM.WRITE_ONLY);
Contact newContact = contactList.createContact();
newContact.addString(Contact.ORG, Contact.STRING, "ACME Corporation");
if ( contactList.isSupportedField(Contact.EMAIL) )
{
newContact.addString(Contact.EMAIL, Contact.STRING, "johndoe#acme.com");
}
newContact.commit();

Resources