# Ionic 2 native contacts (White Screen)

**URL:** <https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760>\
**Category:** ionic-v3\
**Created:** [April 7, 2017, 1:36pm UTC](https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760 "2017-04-07T13:36:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Georgethedev](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Georgethedev](https://forum.ionicframework.com/u/Georgethedev)\
**Post date:** [April 7, 2017, 1:36pm UTC](https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760/1 "2017-04-07T13:36:23Z")

</div>

**I have tried to run the code on different devices and still can Not pass the blank white screen!**

**If I remove contacts import, everything works fine, but with the contacts code in it, whole program stucks on the load.**

**Please, do you have Any Suggestions?**

**this is my code:**

**home.ts**  
import { Component } from ‘@angular/core’;  
import { NavController } from ‘ionic-angular’;  
import { Contacts, Contact, ContactField, ContactName } from ‘@ionic-native/contacts’;

@Component({  
selector: ‘page-home’,  
templateUrl: ‘home.html’  
})  
export class HomePage {  
constructor(public navCtrl: NavController,private contacts: Contacts) { }

showButton(){  
alert(‘activated’);  
let contact: Contact = this.contacts.create();  
[contact.name](http://contact.name) = new ContactName(null, ‘Chat’, ‘Contact’);  
contact.phoneNumbers = [new ContactField(‘mobile’, ‘123456789’)];  
contact.save().then(  
() =\> console.log(‘Contact saved!’, contact),  
(error: any) =\> console.error(‘Error saving contact.’, error)  
);  
}  
}

**home.html**  
  
Show Contact Page…  
  
  
\<button ion-button color=“secondary” (click)=“showButton()”\>Show Conact

System information:  
Cordova CLI: 6.5.0  
Ionic Framework Version: 3.0.1  
Ionic CLI Version: 2.2.1  
Ionic App Lib Version: 2.2.0  
Ionic App Scripts Version: 1.3.0  
ios-deploy version: Not installed  
ios-sim version: Not installed

**I have tested it on the android and iphone, both with the same results …**

---

<div class="post-metadata">

**Author:** ![Georgethedev](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Georgethedev](https://forum.ionicframework.com/u/Georgethedev)\
**Post date:** [April 7, 2017, 3:23pm UTC](https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760/2 "2017-04-07T15:23:11Z")

</div>

**anyone? Someone?**

---

<div class="post-metadata">

**Author:** ![SigmundFroyd](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sigmundfroyd/32/111604_2.png) [@SigmundFroyd](https://forum.ionicframework.com/u/SigmundFroyd)\
**Post date:** [April 7, 2017, 3:30pm UTC](https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760/3 "2017-04-07T15:30:42Z")

</div>

An error of some sort would be nice. Have you checked the logs?

Did you add Contacts as a provider in your app module?

---

<div class="post-metadata">

**Author:** ![Georgethedev](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Georgethedev](https://forum.ionicframework.com/u/Georgethedev)\
**Post date:** [April 7, 2017, 3:42pm UTC](https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760/4 "2017-04-07T15:42:02Z")

</div>

thank you for your reply Sigmund.

I am quite new to ionic development.

Unfortunately, I see no logs at all, not even alert, as it freezes on the load process.

I run the project using: ionic run android

No, I have not added it as a provider. I will give you feedback as soon as I test it.

---

<div class="post-metadata">

**Author:** ![Georgethedev](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Georgethedev](https://forum.ionicframework.com/u/Georgethedev)\
**Post date:** [April 7, 2017, 3:57pm UTC](https://forum.ionicframework.com/t/ionic-2-native-contacts-white-screen/85760/5 "2017-04-07T15:57:07Z")

</div>

Adding as a provider solved the Problem & I marked your response as a Solution.

Thanks a lot!!!

You actually saved my time and nerves …
