Scanning for peripheral devices using BLE in an iOS app

Introduction I had the chance to work on a project where communication via BLE was at the heart of the project. Before adding any code to application, I always asked myself about two scenarios: The first scenario is when the device acts as a central device while searching for and connecting to peripheral devices. The second scenario is when the device acts as a peripheral device by using CBCharacteristic and changes its value....

July 10, 2024 · 3 min · Dmytro Chumakov

Battery Performance Testing for iOS App

Introduction Working with batteries on iOS devices for large applications has always been tricky. The amount of energy consumed by the screen, location services, network calls, processing, background tasks, etc., is significant. From a developer’s perspective, it seems complicated, but Xcode provides tools to address this problem. To find the issue, you need to open Xcode and go to the Debug Navigator. In the Debug Navigator, you will see the Energy Impact gauge....

July 7, 2024 · 1 min · Dmytro Chumakov

Testing push notifications locally in an iOS app

Introduction I always wondered how I could automate testing the push notification process. Even when Apple introduced the possibility of dragging a configured file to the simulator to display a notification, it is still a manual process. I’ll skip testing via the terminal because I think it takes more time than using an APNS file or the RocketSim app. Before I was first introduced to the RocketSim app, I used an APNS file for testing push notifications....

June 19, 2024 · 2 min · Dmytro Chumakov

Adding Push Notifications to an iOS App

Introduction If you start a project from scratch, you need to always create some kind of service like PushNotificationService that will be responsible for handling push notification events. In this article, I want to explore a simple implementation of PushNotificationService to be able to reuse and customize it in future projects. First Step The first step is to add the Push Notifications capability to your project. Go to your project -> Signing & Capabilities -> Tap + Capability -> Search for Push Notifications....

June 14, 2024 · 2 min · Dmytro Chumakov

Implementing In-App Purchases to SwiftUI app using StoreKit 2

Introduction I was wondering how to add in-app purchases to my app. I chose non-consumable in-app purchase because you can pay one time for this item. Here are a few steps on how I did it. First Step Set up In-App Purchases for your app in App Store Connect account or add a .storekit configuration file and start from there. If you’ve already set up In-App Purchases in your account, you can sync the StoreKit config with that data....

May 12, 2024 · 3 min · Dmytro Chumakov