Skip to content

A (borderline hacky) Go client package for Apple's Find My service

Notifications You must be signed in to change notification settings

itsemre/find-my

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-my

A (borderline hacky) Go client package for Apple's Find My service

Installation

go get -u "github.com/itsemre/find-my"

Usage

NewClient
// NewClient creates and initializes a new Find My client object
func NewClient(appleID, password string, extendedLogin bool) (*fmy.Client, error) 
GetUserInfo
// GetUserInfo uses the provided Apple ID credentials and logs in to iCloud to return the user's information
func (c *fmy.Client) GetUserInfo() (*fmy.userInfo, error) 
GetFindMyInfo
// GetFindMyInfo returns all available information for the user's Find My service. It can optionally return the user's
// family members' information as well with: getFamily = true
func (c *fmy.Client) GetFindMyInfo(getFamily bool) (*fmy.findMyInfo, error)
GetDeviceInfo
// GetDeviceInfo returns the information of the device with the provided ID
func (c *fmy.Client) GetDeviceInfo(id string) (*fmy.deviceInfo, error)
GetDeviceLocation
// GetDeviceLocation returns the location information of the device with the provided ID
func (c *fmy.Client) GetDeviceLocation(id string) (*fmy.deviceLocation, error)
AlertDevice
// AlertDevice plays a sound on the device with the provided ID
func (c *fmy.Client) AlertDevice(id string) error 

Example

package main

import (
    fmy "github.com/itsemre/find-my"
)

func main() {
    c, err := fmy.NewClient("<apple_id>", "<password>", true)
    if err != nil {
        panic(err)
    }

    info, err := c.GetFindMyInfo(false) 
    if err != nil {
        panic(err)
    }

    for _, d := range info.Content {
        err = c.AlertDevice(d.ID)
        if err != nil {
            panic(err)
        }
    }
}

The above example gets the IDs of all of the user's devices and uses them to play a sound on them.


This project is based on the pre existing work done by Matt Kruse. For more information, check out this repository.

About

A (borderline hacky) Go client package for Apple's Find My service

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages