我做了这个:
public class PushNotifictionHelper {
public final static String AUTH_KEY_FCM = "AIzaSyD63pfTvnwhe9WVuIe.........";
public final static String API_URL_FCM = "https://fcm.googleapis.com/fcm/send";
public static String sendPushNotification(String deviceToken)
我正在尝试编写地理编码程序。我创建了API密钥,但是当我将它添加到我的网站代码中时,我没有得到任何东西,但是当我不使用API时,一切都运行得很好。当我发送的时候:
https://maps.googleapis.com/maps/api/geocode/json?address=".$adres."&key=KLUCZ_XXX
我得到了一个响应:
Browser API keys cannot have referer restrictions when used with this API.
如果我使用:
https://maps.googleapis.com/map
我已经成功地用我的thisWorks()函数对我的php进行了一次fetch post,但是我试图使用带有异步/等待post ()函数的fetch,但是当我尝试这样做时,我总是得到一个500内部服务器错误响应,我不确定如何调试,因为我的异步函数中的代码和thisWorks()函数中的代码基本上是一样的。
下面是两个函数:
//I can make a succesful post to my api with this function and it returns a 200 ok response from the server
function thisWorks(title, mes