Workout recording sync

I'm a iOS developer, I got problems:

50/50 chance on whether it will actually record a workout on Garmin Connect. I will connect via iOS App AND my watch, and it will show correctly on my watch. Sometimes it works fine, and then there is just a 15 second lag once my workout is done to auto stop the activity and save. But the other 50 of the time, at some point throughout the workout it will just stop midway through without warning, and you're left with nothing. Given that it only tracks your heart rate, and the integration with theiOS App app is minimal, I'll probably just switch to starting a strength activity through Garmin the traditional way. 

I follow steps:

1. Communications.registerForPhoneAppMessages(phoneMethod)

2. iOS send msgs to watch to start record:

ConnectIQ.sharedInstance()?.sendMessage("Start”……

3. Garmin watch received "Start" and start recording:

if ((session == null) || (session.isRecording() == false)) {

session = ActivityRecording.createSession({:name=>"Training", :sport=>ActivityRecording.SPORT_TRAINING,  :subSport=>ActivityRecording.SUB_SPORT_EXERCISE});

session.start();}

4. iOS send msgs to watch to end record:

ConnectIQ.sharedInstance()?.sendMessage("End”…

5.  Garmin watch received "End" and end recording:

if ((session != null) && session.isRecording()) {session.stop();session.save();session = null; }

anyone got same issue?