Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23714] Windows: Calling Ti.Contacts.Group.members() errors with 'Can't find variable: memberIdentifiers'

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-05-30T02:12:17.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsqe-5.4.0
ReporterEwan Harris
AssigneeKota Iguchi
Created2016-08-02T18:22:03.000+0000
Updated2017-05-30T02:13:08.000+0000

Description

Description

When calling Ti.Contacts.Group.members() it errors with 'Can't find variable: memberIdentifiers'.
Ti.Contacts.requestContactsPermissions(function(e) {
    if (e.success) {
        Ti.API.info('auth request success');
        Ti.API.info(JSON.stringify(e));
        var group = Ti.Contacts.createGroup({
			name: 'My best friends'
		});
		
		Ti.Contacts.save();
		console.log('Made group');
	
		var person = Ti.Contacts.createPerson({
				firstName: 'Arthur',
				lastName: 'Evans',
				phone: {
					"work": ["01234566789"]
				}
			});
		Ti.Contacts.save();
	
		group.add(person);
		Ti.Contacts.save();	
		console.log('Added person');
		console.log('Members are');
		console.log(group.members());
    } else {
        Ti.API.info('auth request fail');
        Ti.API.info(e);
    }
});

Steps to reproduce

Copy the code above to an existing app.js

Build for Windows platform

Actual result

When group.members() is called the app will throw an error

Expected result

Calling group.members() should return the members of a group

Comments

  1. Kota Iguchi 2017-05-08

    https://github.com/appcelerator/titanium_mobile_windows/pull/994
  2. Ewan Harris 2017-05-22

    FR Pass! App no longer throws an error when calling .members(), able to loop through the returned object and access the individual contacts returned
       var win = Ti.UI.createWindow();
       var button = Titanium.UI.createButton({title : 'Click'});
       win.add(button);
       win.open();
       button.addEventListener('click', function(e) {
       	Ti.Contacts.requestContactsPermissions(function(e) {
       		if (e.success) {
       			Ti.API.info(JSON.stringify(e));
       			var group = Ti.Contacts.createGroup({
       				name: 'My best friends'
       			});
       			Ti.Contacts.save();
       			var person = Ti.Contacts.createPerson({
       				firstName: 'Arthur',
       				lastName: 'Evans',
       				phone: {
       					"work": ["01234566789"]
       				}
       			});
       			Ti.Contacts.save();			
       			group.add(person);
       			Ti.Contacts.save();	
       			var m = group.members();
       			console.log(typeof m);
       			m.forEach(function(member) {
       				console.log(member.firstName);
       			});				
       		} else {
       			Ti.API.info('auth request fail');
       			Ti.API.info(e);
       		}
       	});
       });
       
    Environment: Microsoft Windows 10 Pro Appc Studio: 4.9.0.201705180402 APPC CLI: 6.2.2-master.15 Lumia 550 (10.0.15063) Looks like I need to get merge rights on this repo, will merge once I get them
  3. Kota Iguchi 2017-05-30

    CR & FR passed and we can close this for now.

JSON Source