Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Adressbook plugin not working
Started by OCG Studios Sep 08 2017 03:01 AM

9 replies to this topic
adress adressbook plugin
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

OCG Studios

[GLOBAL: userInfoPane.html]
OCG Studios
  • Enthusiast

  • 82 posts
  • Corona SDK

We made an app 2 years ago that used the Adressbook plugin so we could have the user add company and government phone numbers to their adress book. in the old build that is live on the app stores it still workes. In a new app we are making we are trying to implement the same feature but without any luck. When we call the native.showPopup function with the adressbook settings it shows nothing, does nothing. When I built the old app with a recent daily build it doesnt work either, something changed in corona versions.
 
For reference I followed the guide on the corona documentation website. 
Corona version: 2017.3103
 
How do we implement this feature in Corona?


[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @OCG Studios,

We will need some details. Where doesn't it work? Which devices and which specific versions of the OS on those devices?

 

Thanks,

Brent



[TOPIC: post.html]
#3

OCG Studios

[GLOBAL: userInfoPane.html]
OCG Studios
  • Enthusiast

  • 82 posts
  • Corona SDK

Hi Brent,

 

De plugin only works on IOS so, it is on iPhone 6/7. This app shows you a list of emergency responders and you can store these to your local contact list. Devices are updated to the latest OS.

 

THe previous app we want to update still runs correctly on the device, a new build does not work correctly with the most recent Corona Build.

 

I hope this is sufficient.

 

Thanks



[TOPIC: post.html]
#4

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @OCG Studios,

Is it possible for you to gather any debug errors/messages? Or create a very basic sample project which we could test with?

 

Thanks,

Brent



[TOPIC: post.html]
#5

OCG Studios

[GLOBAL: userInfoPane.html]
OCG Studios
  • Enthusiast

  • 82 posts
  • Corona SDK

Hi,
 
This is the source that should work (but does not)

 

BUILD.SETTINGS

 

--
-- For more information on build.settings, see the Project Build Settings guide at:
-- https://docs.coronalabs.com/guide/distribution/buildSettings
--
settings =
{
orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
default = "portrait",
supported = { "portrait", },
},
--
-- Android section
--
android =
{
usesPermissions =
{
"android.permission.INTERNET",
},
},
--
-- iOS section
--
iphone =
{
plist =
{
UIStatusBarHidden = false,
UILaunchStoryboardName = "LaunchScreen",
CFBundleIconFiles =
{
"Icon-40.png",
"Icon-58.png",
"Icon-76.png",
"Icon-80.png",
"Icon-87.png",
"Icon-120.png",
"Icon-152.png",
"Icon-167.png",
"Icon-180.png",
},
NSContactsUsageDescription = "This app would like to access your contacts.",
},
},
--
-- Plugins section
--
plugins =
{
["CoronaProvider.native.popup.addressbook"] =
{
publisherId = "com.coronalabs"
},
},
--
-- Project section
--
excludeFiles =
{
-- Exclude unnecessary files for each platform
ios = { "Icon.png", "Icon-*dpi.png", },
android = { "Icon.png", "Icon-??.png", "Icon-???.png", "LaunchScreen.storyboardc", },
},
}

 

MAIN.LUA

 

-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
-- Your code here
--require("addressbook")
native.showPopup( "addressbook",
{
option = "newContact", --"pickContact", "viewContact", "newContact", or `"unknownContact"
--additional options (see below)
firstName = "Jack",
lastName = "Sparrow",
}
)

 

 

Thanks



[TOPIC: post.html]
#6

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @OCG Studios,

Thanks, I tested and I'm getting similar results. We're looking into it further...

 

Brent



[TOPIC: post.html]
#7

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi again,

I found out what needs to be done. At some point since the (long) past, permission handling changed somewhat for the plugin. Now, you need to "get permission" before making the other call to "native.showPopup()", so that the plugin can proceed. So basically, call this before you do other API calls:

 

native.showPopup( "addressbook", { option="getPermission" } )

 

Brent



[TOPIC: post.html]
#8

gurzixo

[GLOBAL: userInfoPane.html]
gurzixo
  • Observer

  • 2 posts
  • Corona SDK

Hello,

 

I am a newbie in Corona, and I apologize in advance if jumping in this topic is considered inappropriate here.

 

My question is very simple:  It looks like accessing contacts is only possible on IOS; is there a possibility to do that on Android also, and if not, are there any plans to provide this?

 

Thanks,

Michel



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,380 posts
  • Enterprise

The Corona address book plugin is iOS only. However the "Contacts" plugin by community developer Scott Harrison should work on Android and iOS both:

 

https://marketplace.coronalabs.com/plugin/contacts

 

Rob



[TOPIC: post.html]
#10

gurzixo

[GLOBAL: userInfoPane.html]
gurzixo
  • Observer

  • 2 posts
  • Corona SDK

Thanks Rob for the instant answer, and thanks Scott for this plugin that a newbie was able to *instantly* test!

 

Cheers,

 

Michel




[topic_controls]
[/topic_controls]