Giter Club home page Giter Club logo

find-my's Introduction

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.

find-my's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.