The Point mode

In this mode, the SDK can receive the movement information of the Ring device in X-Y coordinates format.
The origin (0, 0) is the place where the ring is when its mode has been set to the point mode, and the distance from the origin will be sent to the SDK periodically.

CGPoint

To receive the movement information from the Ring, use the CGPoint struct defined in CoreGraphics

didReceivePoint

You can receive the movement information via this function.

Implementation Example

This example logs the movement information of the Ring device.
Note that the coordinates are set to the origin(0, 0) when a long tap detected because the mode is changed to the gesture once and changed again to the point.

Swift

import UIKit

class ViewController: UIViewController, CRApplicationDelegate {

  var ringApp: CRApplication!

  override func viewDidLoad() {
    super.viewDidLoad()

    ringApp = CRApplication(delegate:self, background: false)
    ringApp.start()
  }

  func didReceiveEvent(event: CRRingEvent) {
    if event == .LongPress {
      print("LongPress")
      ringApp.setRingMode(.Point)
    }
  }

  func didReceivePoint(point: CGPoint) {
    print(point)
  }

  func didReceiveQuaternion(quaternion: CRQuaternion) {
  }

  func didReceiveGesture(identifier: String!) {
  }

  func deviceDidInitialize() {
    ringApp.setRingMode(.Point)
  }

  func deviceDidDisconnect() {
  }
}

Objective-C

#import "ViewController.h"
#import <CoreRing/CoreRing.h>

@interface ViewController () <CRApplicationDelegate>
@property (nonatomic, strong) CRApplication *ringApp;
@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  self.ringApp = [[CRApplication alloc] initWithDelegate:self background:NO];
  [self.ringApp start];
}

- (void)didReceiveEvent:(CRRingEvent)event {
  if (event == CRRingEventLongPress) {
    NSLog(@"LongPress");
    [self.ringApp setRingMode:CRRingModePoint];
  }
}

- (void)didReceivePoint:(CGPoint)point {
  NSLog(@"%@", NSStringFromCGPoint(point));
}

- (void)didReceiveQuaternion:(CRQuaternion)quaternion {
}

- (void)didReceiveGesture:(NSString *)identifier {
}

- (void)deviceDidInitialize {
  [self.ringApp setRingMode:CRRingModePoint];
}

- (void)deviceDidDisconnect {
}

@end

<Events and the Event mode     |     TOP     |     The Quaternion Mode>