Closed yueshiou closed 7 years ago
Yeah, I have the same problem. I'm guessing Apple have changed the process. I'm not sure how that's going to work with out-of-date iPhones, however.
Indeed, Apple_MMe_Host and Apple_MMe_Scope aren't in the headers anymore...
Same here, glad I'm not alone.
It does appear Apple has changed their API structure. As mentioned by EGregius Apple_MMe_Host and Apple_MMe_Scope are not longer in the headers. I've been trying to find out more info about updates to the API. But this would be my first venture into and Apple iCloud API so it's unlikely I'll figure anything out. I used this code regularly so I kind of became reliant on it and its a very clean setup so I like it. Hoping a solution is found soon.
The Lua version for Vera is working already. So there is hope
Apparently Apple simplified the API: https://www.domoticz.com/forum/viewtopic.php?f=23&t=13318&start=120
Yes, replace instances of
$url = "https://".$this->Apple_MMe_Host."/fmipservice/device/".$this->Apple_MMe_Scope."
with
$url = "https://fmipmobile.icloud.com/fmipservice/device/".$this->username."
see this Pull Request #5 for updated code. Tested working on /initClient and /playSound endpoints, not yet tested /refreshClient or /lostDevice
Awesome, that has it working again!
Hi I use this part of the q code changed as follows
If (isset ($ headers ['X-Apple-MMe-Host'])) { $ This-> host = $ headers ['X-Apple-MMe-Host']; $ This-> scope = $ headers ['X-Apple-MMe-Scope']; Throw new FindMyiPhoneException (true); } I would change what there in this code?
Follow the link to my complete code http://pastebin.com/FhHQKJF0
@Halyspectro referring to your pastebin, I would think something like this would fix:
1) remove that portion of code altogether that is checking for the X-Apple-MMe-Host header returned (lines 76-83). Your $host variable will then not be overwritten with the X-apple_mme_host and will remain at fmipmobile.icloud.com
2) amend line 140 request URL to remove reference to obsolete scope; use the bare host URL you defined on line 11:
old:
CURLOPT_URL => sprintf("https://%s/fmipservice/device/%s/%s", $this->host, $this->scope, $method),
new:
CURLOPT_URL => sprintf("https://%s/fmipservice/device/%s", $this->host, $method),
Yes~ Super!! It's working again. My system is back online.
Thank you so~ much.
Error in
Warning: sprintf(): Too few arguments in FindMyiPhone.php on line 133
Follow the code link after the suggested changes http://pastebin.com/AEncEnfY
Are you aware of the new parameter that I have to send instead of the scope?
you don't send anything instead of the scope; the URL is now more simple and you don't need any custom host or scope. You just give it the generic host (fmipmobile.icloud.com)
ah, didn't remove the extra %s
line 132 should be:
CURLOPT_URL => sprintf("https://%s/fmipservice/device/%s", $this->host, $method),
First of all. Many thanks to you for this code. I use it to make a small business. It was working very well. But it suddenly doesn't work last. and I got a error message :
Can you help me? I have no idea of it.
php code :
<?PHP
?> ~