置頂文章

顯示具有 技術 標籤的文章。 顯示所有文章
顯示具有 技術 標籤的文章。 顯示所有文章

2016年6月1日 星期三

[技術] Parse Server的Android與iOS推播設定

參考資料:

https://parse.com/tutorials/push-notifications

https://github.com/ParsePlatform/Parse-Server/wiki/Push

https://github.com/ParsePlatform/Parse-Server/wiki/Push-Configuring-Clients

前面需要在Apple Developer跟Google Console要設定的東西就不詳細介紹,Apple需要憑證來建一個.p12檔來使用,Google Console需要設定一個伺服器端API金鑰、一個Android端金鑰、一個Android端的OAuth 2.0 用戶端 ID。

Server端設定:

push: {
    android: {
      senderId: '', // The Sender ID of GCM
      apiKey: '' // The Server API Key of GCM
    },
    ios: {
      pfx: '', // The filename of private key and certificate in PFX or PKCS12 format from disk  
      passphrase: '', // optional password to your p12
      cert: '', // If not using the .p12 format, the path to the certificate PEM to load from disk
      key: '', // If not using the .p12 format, the path to the private key PEM to load from disk
      bundleId: '', // The bundle identifier associate with your app
      production: false // Specifies which environment to connect to: Production (if true) or Sandbox
    }
  }

這邊官方寫的設定,我沒有設定senderId是可以送推播的,這邊註記一下。

其他在Android跟iOS端的設定,按照上面的參考資料來設定就可以了。

搞了兩天才搞好,真的很累人。

另外也在這邊紀錄一下,之前用php實作推播的時候,在Server也沒有用到senderId,另外也有搜尋到也有人說在Parse上也不用設定senderId,所以才試成功的...。

另外,在第一次是成功的時候,是先把整個GCM跟Parse的Android設定全部寫在一起,這時候Parse上抓到的deviceToken出現了這樣的格式:
|ID|1|:{deviceToken}
但是在Parse上存這樣的資料,Parse Push是沒有辦法正常運作的。所以後來把整個GCM端的設定都拿掉,也是可以運作的。

2015年10月13日 星期二

[技術] Ubuntu vsftp 設定

參考網址:
http://lemonup.logdown.com/posts/175031-ubuntu-vsftpd-install-notes

今天按照這篇文章裝設vsftp之後,登入上傳檔案一直出現550 Permission denied,後來是把文章所寫的vsftpd.conf之中的
guest_enable=YES    #設定pam的user全使用同一個帳號
guest_username=ftp  #設定pam的user所使用的linux帳號
這兩個註解掉重開才可以上傳檔案