Skip to content
프로젝트

소개

Cocoa Touch library for finding information on an iOS device's owner. Inspired by Square's iOS app.

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

JBDeviceOwner

Typing names, email addresses, and other personal info is never fun. This is often your user's first experience with your app, and it sucks.

Fortunately, these data often already exist somewhere on your user's phone. JBDeviceOwner presents them to iOS app developers with a simple interface.

JBDeviceOwner can currently get you the following attributes of the device's owner:

  • Name
  • Email address
  • Phone number

More are coming.

API

JBDeviceOwner *owner = [UIDevice currentDevice].owner;

// owner will be nil if the user's data could not be found.
if (owner != nil) {
  self.firstNameTextField.text = owner.firstName;
  self.lastNameTextField.text  = owner.lastName;
  self.emailTextField.text     = owner.email;
  self.phoneTextField.text     = owner.phone;
}

How does it work?

It's really simple actually.

Most iPhones are named "Jake Boxer's iPhone" (sometimes with a different person's name instead of mine). Most iPhones have their owner saved in their address book.

JBDeviceOwner extracts the owner's name from the device name, finds the matching record in the address book, and populates the JBDeviceOwner instance with the data from the record.

If JBDeviceOwner can't figure out the owner's name, or if it can't find a matching record in the address book, it won't return anything.

How to install

  1. Download the latest framework ZIP from the Downloads tab. Unzip/untar it.
  2. Drag JBDeviceOwner.framework into your project.
  3. Add AddressBook.framework to your project if it's not there already (it's an Apple framework).
  4. Add -ObjC to your target's "Other Linker Flags".
  5. Add #import <JBDeviceOwner/JBDeviceOwner.h> to any file where you want to use JBDeviceOwner.
  6. Delight your users!

Requirements

  • iOS 5.0

Thanks

This library was inspired by Square's iOS app, and by John Feminella's awesome Quora explanation of Square's magic. Fantastic idea, super clear breakdown.

Big thanks to Jeff Verkoeyen for his iOS-Framework guide. For some reason, creating static iOS frameworks is a giant hassle. Jeff made it super easy. Also, this might be the only Xcode tutorial I've ever followed where everything worked as expected.

관련 프로젝트 살펴보기

불러오는 중…