@photon-ai/advanced-imessage-kit 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +34 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -45,7 +45,7 @@ Advanced iMessage Kit is a full-featured iMessage SDK for **reading**, **sending
45
45
  | [Create Polls](#create-polls) | Create interactive polls in chat | `polls.create()` | [poll-create.ts](./examples/poll-create.ts) |
46
46
  | [Vote on Polls](#vote-on-polls) | Vote or unvote on poll options | `polls.vote()` | [poll-vote.ts](./examples/poll-vote.ts) |
47
47
  | [Add Poll Options](#add-poll-options) | Add options to existing polls | `polls.addOption()` | [poll-add-option.ts](./examples/poll-add-option.ts) |
48
- | [Find My Friends](#find-my-friends) _(WIP)_ | Get friends' locations | `icloud.getFindMyFriends()` | [findmy-friends.ts](./examples/findmy-friends.ts) |
48
+ | [Find My Friends](#find-my-friends) | Get friends' locations | `icloud.refreshFindMyFriends()` | [findmy-friends.ts](./examples/findmy-friends.ts) |
49
49
  | [Real-time Events](#real-time-events) | Listen for new messages, typing, etc. | `sdk.on()` | [listen-simple.ts](./examples/listen-simple.ts) |
50
50
  | [Auto Reply](#real-time-events) | Build automated reply bots | `sdk.on()` | [auto-reply-hey.ts](./examples/auto-reply-hey.ts) |
51
51
 
@@ -740,18 +740,39 @@ sdk.on("new-message", (message) => {
740
740
 
741
741
  ---
742
742
 
743
- ## iCloud _(Work in Progress)_
743
+ ## iCloud
744
744
 
745
745
  > Example: [findmy-friends.ts](./examples/findmy-friends.ts)
746
746
 
747
747
  ### Find My Friends
748
748
 
749
749
  ```typescript
750
- // Get friends' locations
751
- const friends = await sdk.icloud.getFindMyFriends();
750
+ // Refresh and get friends' locations
751
+ const locations = await sdk.icloud.refreshFindMyFriends();
752
+
753
+ // Each location contains:
754
+ // - handle: phone number or email
755
+ // - coordinates: [latitude, longitude]
756
+ // - long_address: street address (optional)
757
+ // - expiry: timestamp when location expires (optional)
758
+
759
+ // Find specific friend
760
+ const friend = locations.find((loc) => loc.handle === "+1234567890");
761
+ if (friend) {
762
+ console.log(
763
+ `Coordinates: ${friend.coordinates[0]}, ${friend.coordinates[1]}`
764
+ );
765
+ console.log(
766
+ `Maps: https://maps.google.com/?q=${friend.coordinates[0]},${friend.coordinates[1]}`
767
+ );
768
+ if (friend.long_address) console.log(`Address: ${friend.long_address}`);
769
+ }
752
770
 
753
- // Refresh location data
754
- await sdk.icloud.refreshFindMyFriends();
771
+ // List all friends
772
+ console.log(`All Friends (${locations.length}):`);
773
+ for (const loc of locations) {
774
+ console.log(`${loc.handle}: ${loc.coordinates[0]}, ${loc.coordinates[1]}`);
775
+ }
755
776
  ```
756
777
 
757
778
  > Example: [findmy-friends.ts](./examples/findmy-friends.ts)
@@ -847,7 +868,7 @@ sdk.on("group-icon-removed", (message) => {
847
868
  });
848
869
  ```
849
870
 
850
- ### Find My Friends Events _(WIP)_
871
+ ### Find My Friends Events
851
872
 
852
873
  ```typescript
853
874
  sdk.on("new-findmy-location", (location) => {
@@ -993,12 +1014,12 @@ bun run examples/<filename>.ts
993
1014
 
994
1015
  ### Server & Advanced
995
1016
 
996
- | File | Description |
997
- | ------------------------------------------------- | ----------------------- |
998
- | [server-info.ts](./examples/server-info.ts) | Server info and logs |
999
- | [message-stats.ts](./examples/message-stats.ts) | Message statistics |
1000
- | [findmy-friends.ts](./examples/findmy-friends.ts) | Find My Friends _(WIP)_ |
1001
- | [auto-reply-hey.ts](./examples/auto-reply-hey.ts) | Auto reply bot |
1017
+ | File | Description |
1018
+ | ------------------------------------------------- | -------------------- |
1019
+ | [server-info.ts](./examples/server-info.ts) | Server info and logs |
1020
+ | [message-stats.ts](./examples/message-stats.ts) | Message statistics |
1021
+ | [findmy-friends.ts](./examples/findmy-friends.ts) | Find My Friends |
1022
+ | [auto-reply-hey.ts](./examples/auto-reply-hey.ts) | Auto reply bot |
1002
1023
 
1003
1024
  ---
1004
1025
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photon-ai/advanced-imessage-kit",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Powerful TypeScript iMessage SDK with real-time message processing",
5
5
  "keywords": [
6
6
  "imessage",