You want to integrate your Android app with Facebook Android SDK, Google Play Services or Firebase. With Facebook, you need to config key hash. You can use Facebook manual to get your own key hash or read my blog.
How to download Android Keytool?
Go to Android Keytool’s GitHub repo. Select release tab and download latest .jar file. After download tool, you can open and start using tool. See video demo here. So easy!
Có thể do các API tạo bằng JHipster để dùng trên môi trường web, nên sinh ra cookie là XSRF-TOKEN. Mỗi khi gửi request lên API thì Header có kèm thêm field X-XSRF-TOKEN, value của field này được lấy từ cookie XSRF-TOKEN. JHipster đã làm sẵn cho ta các bước này. Ngoài ra, API còn sử dụng thêm session JSESSIONID để verify request. Nhưng khi gọi API trên Android/iOS, ta phải tự làm các bước giống như trên. Gọi 1 API bất kỳ để sinh ra cookie XSRF-TOKEN. Ta cần lấy tất cả cookie từ response header, lưu lại để dùng cho các request sau. Khi tạo request mới, thì gán các cookie đã lưu vào request header. Ngoài ra, ta cần tìm cookie XSRF-TOKEN, lấy value gán cho field X-XSRF-TOKEN ở request header. Khi có response ở bước 2, ta lặp lại bước 1. Khi lưu và lấy cookie cần lưu theo domain để tránh trùng cookie do API sinh ra với cookie do website khác sinh ra. Ví dụ thực tế trên iOS: JHipster sinh ra session JSESSIONID, ta lưu cookie vào NSHTTPCookieStorage và không theo domain. (1) Mở 1 ...
Nếu bạn đang configure port cho SSH, sau đó restart lại sshd mà gặp báo lỗi kiểu như thế này Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Thì hãy chạy lệnh journalctl -xe để xem báo lỗi cụ thể là gì nhé. Giả sử ta đang configure port number là 9999, lúc này báo lỗi sẽ có dạng Dec 04 22:25:16 localhost sshd[25003]: error: Bind to port 9999 on 0.0.0.0 failed: Permission denied. Dec 04 22:25:16 localhost sshd[25003]: error: Bind to port 9999 on :: failed: Permission denied. Dec 04 22:25:16 localhost sshd[25003]: fatal: Cannot bind any address. Dec 04 22:25:16 localhost systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a Dec 04 22:25:16 localhost systemd[1]: Failed to start OpenSSH server daemon. -- Subject: Unit sshd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -...
Dạo gần đây, dự án của chúng tôi xuất hiện một yêu cầu "nho nhỏ" là làm sao để các bạn tester có thể lấy được bản build hiện tại khi log bug . Ví dụ như là test vào thời gian nào, ở branch hay commit nào, version bao nhiêu, vân vân và mây mây... Hầu như ai cũng giá như mà dùng Jenkins thì ngon 😂. Khổ một nỗi là để setup được Jenkins cho dự án của chúng tôi chắc cũng lâu lâu lâu nữa mới dùng được. Cực chẳng đã, tôi nghĩ ra 1 cách à sao mình không làm 1 cái alias tới lệnh git để lấy mã hash của commit hiện tại nhỉ? Phiên bản 1 (khá ngon) Tôi mở ngay terminal của server gõ lệnh vi /etc/profile thêm ngay đoạn code bên dưới vào: # Alias current_commit=git rev-parse HEAD Mỗi khi các bạn tester connect SSH vào server, thì file profile được load và các bạn ý có ngay 1 câu lệnh current_commit để lấy mã hash thay vì phải biết git Phiên bản 2 (pro hơn) Các bạn tester vẫn phải tự viết thêm thời gian test, branch hiện tại. Thì mình in ra thêm là xong thôi mà, có điều...
Nhận xét
Đăng nhận xét