文章

顯示從 11月, 2024 起發佈的文章

Clone Github with personal access token

Github doesn't support cloning with username password. With personal access token (PAT): git clone https:// <PAT> @ github.com/path/repo.git

Implementing Push Notification in iOS apps using Firebase Cloud Messaging

This article shows example codes in both iOS side and server side to let you know how to make use of Firebase Cloud Messaging (FCM) to implement push notification for your iOS app. You need to use the  Firebase  for your iOS app. Not in this article I will not go into detail on how to setup in Xcode side nor the certification issues. There are tons of articles on the web for those. The steps for this part are same for any platforms. Basic concept about iOS push notification Almost every iOS app needs push notification. And you don’t want to deal with  complicated details . Here is the basic components you need to know. Your iOS app. This faces to human users. The Apple push notification service. This service, or server, belongs to Apple. It sends the notification to every iOS device upon it receives requests from your application server. A server application. This server, or a server application, will send requests to the Apple push notification service when it wants to n...

How to sync swiftdata with iCloud

How to sync swiftdata with iCloud If you want to sync your app's data to iCloud, go to the Signing & Capabilities settings for your app's target, then: Add the iCloud capability. Select CloudKit from its options. Press + to add a new CloudKit container, or select one of your existing ones. Add the Background Modes capability. Check the box "Remote Notifications" checkbox from its options. …and that's it: your app is now configured to sync all its data with iCloud. Tip: Although you can attempt to test iCloud support in the simulator, I've found it rarely works well – it's much better to test on a real device. Although the configuration is complete, you might need to make some changes to your SwiftData models because CloudKit has a few very specific requirements. Annoyingly, if you don't follow these requirements your iCloud sync will silently fail, so here they are: You cannot use @Attribute(.unique) on any property you want to sync to CloudKit. Al...

結婚的意義

圖片
今天看到一段話, 說婚姻是你這輩子, 唯一一次親自選擇家人。 你想和什麼樣的人,牽手走完這一生, 就找什麼樣的人。 終有一天你會明白,經濟基礎固然重要, 但更重要的是,一個人的教養,擔當,責任心,控制情緒的能力, 以及說話方式和處事態度。 結婚的意義就是, 萬家燈火,有一盞燈為你而留, 而不是雞飛狗跳有你一個。 伴侶真的很重要, 晚一點沒關係, 但一定得是對的人。 因為他是你後半輩子裡的光。 (摘自網路)

餐肉和垃圾郵件

圖片
餐肉和垃圾郵件都叫 spam 。 原來根據 Wikipedia, 垃圾郵件 的英語和午餐肉同為「Spam」。語源來自英國搞笑節目《 蒙提·派森 》中以午餐肉為題的搞笑短劇,說一間餐廳供應的餐點全是午餐肉,而且還有一群維京人打扮的食客唱著不斷重覆「Spam」這歌詞的讚歌,令人煩厭。 有趣 。