-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-macos.sh
More file actions
executable file
·65 lines (59 loc) · 2.42 KB
/
run-macos.sh
File metadata and controls
executable file
·65 lines (59 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Script to run the message relay service directly on macOS
# This allows direct access to the Messages app without Docker
echo "Starting Message Relay Service on macOS..."
echo "This will have direct access to the Messages app"
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ Warning: .env file not found!"
echo "📱 Phone numbers can be provided in webhook requests instead"
echo "💡 Or create a .env file with PHONE_NUMBERS for fallback"
else
# Load environment variables if .env exists
export $(cat .env | xargs)
# Check if PHONE_NUMBERS is set (optional now)
if [ -z "$PHONE_NUMBERS" ]; then
echo "⚠️ Warning: PHONE_NUMBERS not set in .env file"
echo "📱 Phone numbers can be provided in webhook requests instead"
else
echo "✅ Phone numbers configured: $PHONE_NUMBERS"
echo "💡 These will be used as fallback when no phone numbers in request"
fi
fi
echo ""
echo "🚀 Starting server on http://localhost:3000"
echo "📡 Webhook endpoint: POST /webhook"
echo ""
echo "🎯 NEW: Group Chat Support Available!"
echo "💡 You can now send messages to existing group chats!"
echo ""
echo "📋 Usage Examples:"
echo ""
echo "1. 🎯 Send to Existing Group Chat:"
echo " curl -X POST http://localhost:3000/webhook \\"
echo " -H \"Content-Type: application/json\" \\"
echo " -d '{\"message\": \"Meeting at 6pm!\", \"groupKeyword\": \"Work Team\"}'"
echo ""
echo "2. 📱 Send to Custom Phone Numbers:"
echo " curl -X POST http://localhost:3000/webhook \\"
echo " -H \"Content-Type: application/json\" \\"
echo " -d '{\"message\": \"Hello!\", \"phoneNumbers\": [\"+1234567890\"]}'"
echo ""
echo "3. 🌍 Use Environment Fallback:"
echo " curl -X POST http://localhost:3000/webhook \\"
echo " -H \"Content-Type: application/json\" \\"
echo " -d '{\"message\": \"Hello!\"}'"
echo ""
echo "4. 🎯 Group Chat + Phone Numbers (for fallback):"
echo " curl -X POST http://localhost:3000/webhook \\"
echo " -H \"Content-Type: application/json\" \\"
echo " -d '{\"message\": \"Group message!\", \"phoneNumbers\": [\"+1234567890\"], \"groupKeyword\": \"Weekend Crew\"}'"
echo ""
echo "🔍 To find your group chat names:"
echo " - Open Messages app"
echo " - Look at the chat names in the sidebar"
echo " - Use part of the name as your groupKeyword"
echo ""
echo "Press Ctrl+C to stop"
# Run the service
node src/server.js